[clang-format] Add SpaceBeforeCpp11BracedList option.
authorHans Wennborg <hans@hanshq.net>
Thu, 14 Jun 2018 08:01:09 +0000 (08:01 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 14 Jun 2018 08:01:09 +0000 (08:01 +0000)
commitbfc340653022b00383c97db117719d15d20bdfa3
treef6145004922987f12a6f02dbe3a96908f41ac575
parent49fad1cbf2bba88a5c0d596e3aa46d142f9d73ad
[clang-format] Add SpaceBeforeCpp11BracedList option.

WebKit C++ style for object initialization is as follows:

  Foo foo { bar };

Yet using clang-format -style=webkit changes this to:

  Foo foo{ bar };

As there is no existing combination of rules that will ensure a space
before a braced list in this fashion, this patch adds a new
SpaceBeforeCpp11BracedList rule.

Patch by Ross Kirsling!

Differential Revision: https://reviews.llvm.org/D46024

llvm-svn: 334692
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp