<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54398>54398</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Incorrect formatting of else if over conditionally compiled code
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
isolansky
</td>
</tr>
</table>
<pre>
clang-format 12.0.0
`
while (true) {
#if DEF_SET_ANOTHER
if (var == 1) {
;
} else
#endif /* DEF_SET_ANOTHER */
if (var == 3) {
;
} else if (var == 4) {
;
} else if (var == 5) {
;
}
};
`
clang-format 13.0.0, 14RC4
`
while (true) {
#if DEF_SET_ANOTHER
if (var == 1) {
;
} else
#endif /* DEF_SET_ANOTHER */
if (var == 3) {
;
} else if (var == 4) {
;
} else if (var == 5) {
;
}
};
`
.clang-config:
AlignConsecutiveMacros: false
BasedOnStyle : "Google"
IndentWidth : 4
MaxEmptyLinesToKeep : 1
TabWidth : 1
UseTab : "Never"
Issue is obvious, it formats following code differently
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlUstu2zAQ_BrqQkSQSCmWDzrYsd0GbRIgcdBjQIkrmS0tGiTl1H_f1cNO3bRo2h5LCOJjdneWnCmMPOSlFk19URm7FZ7GLIzCiEQLEs3I5bh43igNlLDM2xYIm1IymY8hjKuKLparp4fl-ml2e7d-v7wfIIoDMczaC0sJX-BH47NsOg7CvzsgkwUF7eBEAI3s66wIm_1IhcezDjkr94qVv531dXLyL8npm5LHq-LiCJyefvifS8R7idgVjZP7q-S_0OoV899o9odFfq7dr4r8VsPhHw5SlqapVE34GTbTqm6uTOOgbL3aw40orXEYRCtxeuS5cCDvmgd_6GRGjDD2zphao9hsCLluJDT-k5J-00eMFrkRX5fbnT98VA24tfkAsOvheIDXonhJGc8eHeDxkeYW9mBPLCOXcy2-naOm2CvTus6WytPBqg5nrc2zampaGgkUzVGBxeb0YUgPZM7llE9F4JXXkF83pbEWymMF36Wa6qSQwQ6wFLrMK9MIrQ-42-7Q8rJnCFqr8433u-7ZehuuauU3bRFiGG603h-ni501n5EJt6q7BLa-ShM-zYJNXhYTKLNJWU6ibJJNi2TKy1QKLngieSbiQIsCW8pJOifpIlA5ixiLeHwZR0nG0xAEFFHEUgnRJatiSZIItkLpsCMOja0Dm_c9FG3tENTKefcCCufQCQDH-qL1G2Nz5Qyax305BH3Ded_tN8OKh5A">