You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BreakBeforeBraces: Custom
# if true this allows if (a) { return; } to be put on a single line.
AllowShortBlocksOnASingleLine: Always
# If true, if (a) return; can be put on a single line.
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
BraceWrapping:
AfterControlStatement: Always
BeforeElse: true
produces different result on clang-format-20 vs clang-format-21 and the version 21 appears to be incorrect.
It appears that the AfterControlStatement: Always is ignored in clang-format-21
The else block below has a different in brace-wrapping
// with clang-format-20intfoo() {
int bar = 0;
int verylooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongvar;
if (bar) { return bar; }
else
{
return verylooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongvar;
}
}
// with clang-format-21intfoo() {
int bar = 0;
int verylooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongvar;
if (bar) { return bar; }
else {
return verylooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongvar;
}
}