<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 misformats code"
href="https://bugs.llvm.org/show_bug.cgi?id=36857">36857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format misformats code
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>redbeard0531@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>Config: <a href="https://github.com/mongodb/mongo/blob/master/.clang-format">https://github.com/mongodb/mongo/blob/master/.clang-format</a>
Specific issues:
&& is has spaces on both sides when it should have none on left side (next line
is formatted correctly):
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L82">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L82</a>
and
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L983">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L983</a>
space between Type and *:
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L740-L741">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L740-L741</a>
spaces inside [] of lambda capture:
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1050">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1050</a>
function signature indented too much:
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L940">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L940</a>
(compare to
<a href="https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1005">https://github.com/mongodb/mongo/blob/9799d8b7223205635ccb428bbec1ba4d947ba13b/src/mongo/util/future.h#L1005</a>
which is indented correctly)
Our official code is formatted by clang-format 3.8, but I've also tried 5.0 and
today's trunk, but they seem to still have these issues. Most of our code is
formatted very nicely by clang-format, but something about this file causes it
to behave very strangely. While I only linked to 1 or 2 instances of each
issue, they all occur several times in that file.</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>