<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123039>123039</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unexpected interaction between ColumnLimit = 0 and BWACS_MultiLine
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
semushin-s
</td>
</tr>
</table>
<pre>
Let's say we have the following config
```
BasedOnStyle: WebKit
ColumnLimit: 0
BreakBeforeBraces: Custom
BraceWrapping:
AfterControlStatement: MultiLine
```
As a result any of the following snippets do not change after formatting (as if it's ok to either wrap or not wrap the brace regardless of if being multilien):
```cpp
bool f(int b)
{
if (b)
{
return true;
}
return false;
}
```
```cpp
bool f(int b)
{
if (b) {
return true;
}
return false;
}
```
```cpp
bool f(int b)
{
if (b
&& true) {
return true;
}
return false;
}
```
```cpp
bool f(int b)
{
if (b
&& true)
{
return true;
}
return false;
}
```
I think the correct behaviour should be to consider control statement having any line breaks before formatting or not in such case.
If I'm not mistaken [here](https://github.com/llvm/llvm-project/blob/fb13e65acf0b7de3dd0b60b6312df07fdf9da652/clang/lib/Format/UnwrappedLineFormatter.cpp#L318) is the place where we check is statement multi line or not based on column limit only.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVU2P4ygU_DXk8jQRhrYTH3xwumVptL3aQ2vUxxUfD5sNBgtwZ_PvVziZ7tbcZqTRRpGCKPIoileFSMmOHrEj9YnUTzux5inELuG8psn6L2kng752z5gJOyRI4goXhEm8IeQJwQTnwsX6EVTwxo6E9qSh9y_tTyKh_su_5KtDwnt4RfmHzYT2j8Gts3-2s81lflsbUZxPaELEUxQKUwEe15TDvKFC4WsUy2L9SHhPaA_Qm4zxMfgcg3vJIuOMfqv35-qyfbYef-DTJxAQMa0ug_BXCOaHUyRvlwVzAh3AhwxqEn5EEGUjMCHOIueyjrCjSGAN2Jsu4Qw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