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

Ross Kirsling via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 10:02:54 PDT 2018


rkirsling added a comment.

In https://reviews.llvm.org/D46024#1079390, @klimek wrote:

> Is this written down somewhere? https://webkit.org/code-style-guidelines/ doesn't seem to mention it.


I agree that it really ought to be mentioned thereā€”I'll try to bring that up with the original authors of that document.

It is enforced by the style checker (though the rule is not specific to braced initialization):
https://github.com/WebKit/webkit/blob/master/Tools/Scripts/webkitpy/style/checkers/cpp.py#L1972-L1978

Statistically speaking, when grepping the Source directory (excluding Source/ThirdParty) for *.h and *.cpp files:

- with space (`\w+\s\{.*\};`) has 11544 matches across 2744 files
- without space (`\w+\{.*\};`) has 29 matches across 10 files


Repository:
  rC Clang

https://reviews.llvm.org/D46024





More information about the cfe-commits mailing list