<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62721>62721</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Short function option not respected after preprocessor with ColumnLimit 0 and BraceWrapping AfterFunction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rymiel
</td>
</tr>
</table>
<pre>
Very specific setup, but I believe it's all required. Tested with clang format versions 14, 15, 16 and trunk (58e6caaba1cf623292c8898be30a5a56722432b3)
Given this source file:
```cpp
struct Foo {
#pragma foo
int foo() { return 0; }
};
```
Formatted with the following config:
```yaml
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
ColumnLimit: 0
```
Results in:
```cpp
struct Foo {
#pragma foo
int foo()
{
return 0;
}
};
```
The pragma may be replaced with any preprocessor directive
The surrounding class seems to be required too, for some reason
I believe this might be #35805, but that issue didn't mention BraceWrapping.AfterFunction, I'm inclined to close that one since it doesn't reproduce with just the information there, I believe something went missing
Discovered here: https://github.com/SerenityOS/serenity/pull/18766/files#r1193013334
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVN-LpDgQ_mvSL8U0mmirDz5MT-OxcHBws9w9x1i22Y2Jl0p66P_-iPbMdB_sciyIYiX16_uqPkmkzxaxZeWRlaedjGFyvvXXWaPZ9W64tn-hvwItqPSoFRCGuDD-An0M8AV6NBovCDowXhFIY8DjP1F7HPbwFSngAG86TKCMtGcYnZ9lgAt60s4S5EUKlZfr-wDSDhB8tN-B8bqs8aCk7GWuxgMXvOGqrpu6R5HJUpaHivNC8F4w3rDsxLLn7f2bvqCFMGkCctErhFEbZOL5_hI7ZNujlmWzUPBRBeicA1Ydb7e4WLw8zxJG5zaTtmH94TXjTboJHkP0FjImjsCq082zOjFx_E-u-wK6FYgPdMKEMDpj3Ju2Z1DOjvr8o5Kvcjab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