<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59778>59778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format doesn't remove braces if `} else if (...) {`barely doesn't fit
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
owenca
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
owenca
</td>
</tr>
</table>
<pre>
Version: 15 and main
```
% cat test.cpp
if (foo) {
f();
} else if (bar || baz) {
g();
}
% clang-format -style='{ColumnLimit: 20, RemoveBracesLLVM: true}' test.cpp
if (foo) {
f();
} else if (bar ||
baz) {
g();
}
```
Expected:
```
if (foo)
f();
else if (bar || baz)
g();
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysUs2umzwUfJrDxgoyx4DDwov8fFnl23Rx9wYfiCuDI9vcNn36ivy0ube9lSoVISHGmuOZM6NjtMNEpKDaAqL_QlOnARGqfabndPJB3bCs9eaiXihE6ycQG1ZUTE-GjdpOwPfAN1Dz-3v7xYp1OrFEMeXd-XxDbc8A1733gA0Dub2hjPWAa8AGxB0BuWfkIrEbodWBgdyB3LFWf3vHHX7lPklwehpWvQ-jTmwV08URiD2gBLndeTeP09GONi2OkAPu2Cca_Sttg-4oHo8v_y8nKcy0TEXJ_rWfB-HH8zf-3m78v69n6hIZEJvfnj9r_Ujnn3b-oZ7HNZlRwjSi0RmpopZYF7WQPDspqoxpC1mXopHSVHUpZV3ydWfWbV2WXZFZhRwFL3iBQjSC531VN7ozKLhAariAktOorcudex1zH4bMxjiTqhop15nTLbl47_Bz4vcmB7XQVu08RCi5szHFn4OSTY7Um54YT3EClImFaxtYe63DdTE1f5dlnuePwGre6kDu8jSgtymbg1OnlM5xSQYPgIfBptPc5p0fAQ-LkvtndQ7-M3UJ8HD1FwEPV4vfAwAA__8jhQBI">