<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 - BraceWrapping: SplitEmptyRecord ignored when AfterFunction is true"
href="https://bugs.llvm.org/show_bug.cgi?id=34778">34778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>BraceWrapping: SplitEmptyRecord ignored when AfterFunction is true
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</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>gerbo.engels@ortec-finance.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>The following works as expected:
$ echo "template<typename T> struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: false,
AfterStruct: true, SplitEmptyRecord: false}}"
template <typename T> struct X
{};
Change AfterFunction to true:
$ echo "template<typename T> struct X{};" | clang-format -style="{BasedOnStyle:
llvm, BreakBeforeBraces: Custom, BraceWrapping: { AfterFunction: true,
AfterStruct: true, SplitEmptyRecord: false}}"
template <typename T> struct X
{
};
I would not expect AfterFunction to interfere with the formatting of a struct
(combined with SplitEmptyRecord).
Might be related to <a class="bz_bug_link
bz_status_NEW "
title="NEW - BraceWrapping: AfterFunction flag interferes with formatting of empty class body"
href="show_bug.cgi?id=25132">https://bugs.llvm.org/show_bug.cgi?id=25132</a> and
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang-format BreakConstructorInitializers ignored if BraceWrapping->AfterFunction is true"
href="show_bug.cgi?id=34008">https://bugs.llvm.org/show_bug.cgi?id=34008</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>