[PATCH] D125137: [clang-format] Don't remove braces if a 1-statement body would wrap

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 22:37:23 PDT 2022


owenpan added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:25374
   verifyFormat("if (a) {\n"
                "  b = c >= 0 ? d\n"
                "             : e;\n"
----------------
Jeroen wrote:
> Will it also add braces if they where not there yet?
No, but you can insert braces by setting `InsertBraces` to true and `RemoveBracesLLVM` to false.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125137/new/

https://reviews.llvm.org/D125137



More information about the cfe-commits mailing list