<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 - clang-format reformats already formatted code (comment before preprocessor directive)"
href="https://bugs.llvm.org/show_bug.cgi?id=35033">35033</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format reformats already formatted code (comment before preprocessor directive)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>curdeius@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>Tested on clang-format trunk r316311 from 2017-10-23.
The following code:
```
{
// clang-format off
#define M 5
}
```
gets formmatted to:
```
{
// clang-format off
#define M 5
}
```
Reformatting again leads to the original code again... and it cycles.
Apparently, it has to do with comments before preprocessor directives and seems
to be related to <a class="bz_bug_link
bz_status_NEW "
title="NEW - newline between comments and preprocessor directive doesn't stop clang-format from lining comment up with preprocessor directive"
href="show_bug.cgi?id=31911">bug #31911</a> (<a class="bz_bug_link
bz_status_NEW "
title="NEW - newline between comments and preprocessor directive doesn't stop clang-format from lining comment up with preprocessor directive"
href="show_bug.cgi?id=31911">https://bugs.llvm.org/show_bug.cgi?id=31911</a>).</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>