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
The RemoveBracesLLVM option doesn't remove the braces of an else block that contains a single if statement when the body of the if statement is a block:
$ cat test.cppvoid f() { if (a1) f1(); else { if (a2) f2(); } if (a3) f3(); else { if (b) { g(); h(); } }}
$ clang-format -versionclang-format version 15.0.0 (https://github.com/llvm/llvm-project 09865ae95dbf0322bbf3e7b3847b2b11373a0297)
$ clang-format -style="{InsertBraces: true, RemoveBracesLLVM: true}" test.cppvoid f() { if (a1) f1(); else if (a2) f2(); if (a3) { f3(); } else { if (b) { g(); h(); } }}
Change the signatures of parseBlock(), parseLevel(), and
parseStructuralElement() to support combining else and if when
removing braces. See #55663.
Differential Revision: https://reviews.llvm.org/D127005
The
RemoveBracesLLVM
option doesn't remove the braces of anelse
block that contains a singleif
statement when the body of theif
statement is a block:Expected output:
The text was updated successfully, but these errors were encountered: