<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 - Comments after preprocessor directives are misaligned to code-level"
   href="https://bugs.llvm.org/show_bug.cgi?id=43648">43648</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Comments after preprocessor directives are misaligned to code-level
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>clemensgru@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>Comments before preprocessor directives are correctly identified as belonging
to the directive and are not aligned to code-level.

The line '// FOO begins' in the following example is not changed by
clang-format. This works as expected.

void main(void) {
  int i = 0;

// FOO begins
#ifdef FOO
  i++;
#endif
// FOO ends
}

However, clang-format (tested with version 9.0.0) does indent the line '// FOO
ends', which is not correct in my opinion. Similar to a namespace end comment,
this tells readers which ifdef this endif is closing and should be aligned with
the directive, or at least be preserved if it is already aligned that way.</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>