[PATCH] D116316: [clang-format] Add an experimental option to remove optional control statement braces in LLVM C++ code

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 29 22:39:53 PST 2021


owenpan added inline comments.


================
Comment at: clang/unittests/Format/FormatTest.cpp:23224
+
+  EXPECT_EQ("if (a)\n"
+            "  if (b)\n"
----------------
owenpan wrote:
> MyDeveloperDay wrote:
> > any reason these can't be verifyFormats?
> Did you mean to add the expected part as a separate case? I don't think it would add any value if there are no braces to remove in the first place?
> Did you mean to add the expected part as a separate case? I don't think it would add any value if there are no braces to remove in the first place?

Nvm. I think you wanted something like `verifyFormat(PostformatCode, PreformatCode, Style)`? Yes, I could do that, but I would have to relax the restriction to calling `BracesRemover()` in Format.cpp, i.e. checking `isCpp()` instead.


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

https://reviews.llvm.org/D116316



More information about the cfe-commits mailing list