[PATCH] D46024: [clang-format] Add SpaceBeforeCpp11BracedList option.

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 12 10:27:29 PDT 2018


klimek accepted this revision.
klimek added a comment.

In https://reviews.llvm.org/D46024#1129350, @hans wrote:

> In https://reviews.llvm.org/D46024#1121242, @rkirsling wrote:
>
> > FWIW, please note that this space-before-brace style is not specific to WebKit; CppCoreGuidelines exhibits it as well:
> >  http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es23-prefer-the--initializer-syntax
>
>
> This and WebKit's style seem like compelling arguments to support this option.
>
> klimek, djasper: Do you have any objections against landing this?


Agreed.
Generally LG minus that I'd significantly reduce the number of test cases :)



================
Comment at: unittests/Format/FormatTest.cpp:6980
                ExtraSpaces);
+
+  FormatStyle SpaceBeforeBrace = getLLVMStyle();
----------------
There are super many redundant test cases here - I don't think we need to test that brace init detection works here, again.
I think given the code change we basically need 2 tests:
one where the previous opens a scope, and one where it doesn't.


Repository:
  rC Clang

https://reviews.llvm.org/D46024





More information about the cfe-commits mailing list