summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-16 18:22:10 +0000
committerDaniel Jasper <djasper@google.com>2013-07-16 18:22:10 +0000
commit6ab5468637453ffc90fcc8036e40615c1e04b775 (patch)
treef4b6b7fd02c89c4117b16554bb53bbdef078d6f5 /clang/lib/Format/TokenAnnotator.cpp
parent3d527d80b86d98ae80b50db0814d2dc075227bd9 (diff)
downloadbcm5719-llvm-6ab5468637453ffc90fcc8036e40615c1e04b775.tar.gz
bcm5719-llvm-6ab5468637453ffc90fcc8036e40615c1e04b775.zip
Revamp the formatting of C++11 braced init lists.
The fundamental concept is: Format as if the braced init list was a function call (with parentheses replaced by braces). If there is no name/type before the opening brace (e.g. if the braced list is nested), assume a zero-length identifier just before the opening brace. This behavior is gated on a new style flag, which for now replaces the SpacesInBracedLists style flag. Activate this style flag for Google style to reflect recent style guide changes. llvm-svn: 186433
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 2d1c1e3f4ac..7a2364c0b9a 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1167,7 +1167,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
if (Left.is(tok::l_brace) && Right.is(tok::r_brace))
return false; // No spaces in "{}".
if (Left.is(tok::l_brace) || Right.is(tok::r_brace))
- return Style.SpacesInBracedLists;
+ return !Style.Cpp11BracedListStyle;
if (Right.Type == TT_UnaryOperator)
return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
(Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
OpenPOWER on IntegriCloud