<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 - Namespaces with one function declaration get formatted incorrectly"
href="https://bugs.llvm.org/show_bug.cgi?id=36766">36766</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Namespaces with one function declaration get formatted incorrectly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>artemiev.mikhail@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>Let's consider this example:
$ cat test.cpp
namespace Foo1 { // contains a single function declaration
void a();
}
namespace Foo2 { // contains multiple function declarations
void a();
void b();
}
namespace Bar { // contains a single function definition
void b() {}
}
namespace Baz { // contains mixed definitions/declarations
void b() {}
void a();
}
clang-format formats incorrectly the first namespace:
$ clang-format --style=llvm ~/main6.cpp
namespace Foo1 { // contains a single function declaration
void a();
}
namespace Foo2 { // contains multiple function declarations
void a();
void b();
} // namespace Foo2
namespace Bar { // contains a single function definition
void b() {}
} // namespace Bar
namespace Baz { // contains mixed definitions/declarations
void b() {}
void a();
} // namespace Baz
clang-format removes a blank line before the closing brace and it doesn't fix
the namespace comment.</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>