<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Continuation of long lines aligns with start of line instead of start of instruction"
   href="https://bugs.llvm.org/show_bug.cgi?id=47097">47097</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Continuation of long lines aligns with start of line instead of start of instruction
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Formatter
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>waris.boonyasiriwat@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23838" name="attach_23838" title="3 files: (1) the dummy test file (2) .clang-format for v10 (3) .clang-format for v6">attachment 23838</a> <a href="attachment.cgi?id=23838&action=edit" title="3 files: (1) the dummy test file (2) .clang-format for v10 (3) .clang-format for v6">[details]</a></span>
3 files: (1) the dummy test file (2) .clang-format for v10 (3) .clang-format
for v6

Version:
clang-format version 10.0.0-4ubuntu1~18.04.2

Overview:
Continuation of long lines seem to align with the start of line instead of
start of instruction. This behaviour did not exist in clang-format-6.0.

Steps to reproduce:
Run clang-format with ColumnLimit of 120 and ContinuationIndentWidth of 2 on
this snippet (also attached).

void foo()
{
    if (SUCCESS_CONSTANT
        == a_really_really_really_long_function_name(
               reinterpret_cast<uint8_t*>(a_somewhat_long_argument),
a_somewhat_long_argument,
              
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
              
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
    {
        // do stuff
    }
}

Expected Result (what I got with clang-format-6.0):

void foo()
{
    if (SUCCESS_CONSTANT
        == a_really_really_really_long_function_name(
             reinterpret_cast<uint8_t*>(a_somewhat_long_argument),
a_somewhat_long_argument,
            
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
            
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
    {
        // do stuff
    }
}


Actual Result (what I got with clang-format-10):

void foo()
{
    if (SUCCESS_CONSTANT
        == a_really_really_really_long_function_name(
          reinterpret_cast<uint8_t*>(a_somewhat_long_argument),
a_somewhat_long_argument,
         
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
         
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
    {
        // do stuff
    }
}


Notice how the continued line is aligned to the left of the function name. I
tried tweaking many other rules but did not seem to help. This led me to
believe that the alignment reference for long line continuation has been
changed from "start of instruction" to "start of line"</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>