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
void f(int a) {
if (a > 0) {
return;
} else {
// comment-1
return;
}
}
into
void f(int a) {
if (a > 0) {
return;
} // comment-1
// another line
return;
}
which is problematic because comment-1 is associated with the subsequent line, not with the preceding closing brace. This trips up clang-format as well.
A better fix would have been
void f(int a) {
if (a > 0) {
return;
}
// comment-1
// another line
return;
}
which can then get formatted correctly by clang-format.
I'm not sure how to produce the correct fix here without breaking other cases, though.