<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 Does not Break Before Brace After `Extern "c"` With Setting `BreakBeforeBraces: Allman`"
href="https://llvm.org/bugs/show_bug.cgi?id=26689">26689</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang-format Does not Break Before Brace After `Extern "c"` With Setting `BreakBeforeBraces: Allman`
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>sanssecours@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Clang-Format does not add a break before a opening brace after `extern "C"` if
the setting `BreakBeforeBraces` is set to `Allman`. This is not the expected
behaviour, since official documentation [1] states, that Clang-Format always
breaks before braces if we use this option.
Example: If we save the code
```cpp
extern "C"
{
int foo()
{
return 1;
}
}
```
in a file called `extern.cpp` and format it using `clang-format
-style='{BreakBeforeBraces: Allman}' extern.cpp`, then `clang-format` prints
the following:
```cpp
extern "C" {
int foo() { return 1; }
}
```
However, the expected result is
```cpp
extern "C"
{
int foo() { return 1; }
}
```
or
```cpp
extern "C"
{
int foo() { return 1; }
}
```
[1]: <a href="http://clang.llvm.org/docs/ClangFormatStyleOptions.html">http://clang.llvm.org/docs/ClangFormatStyleOptions.html</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>