summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-07 07:59:03 +0000
committerDaniel Jasper <djasper@google.com>2014-05-07 07:59:03 +0000
commit7a2d60e32850a69b0d9f5d7324f99a6c94cf9721 (patch)
treeed5ac26884f0d5e3b2a992a8f54a359c3fe78b27 /clang/lib/Format
parent3819f028190dfaa51a7a819b42be0bb508437504 (diff)
downloadbcm5719-llvm-7a2d60e32850a69b0d9f5d7324f99a6c94cf9721.tar.gz
bcm5719-llvm-7a2d60e32850a69b0d9f5d7324f99a6c94cf9721.zip
clang-format: Fix bad space before braced initializer.
Before: new int {1}; After: new int{1}; llvm-svn: 208168
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 8becd00897a..a41992679ad 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1483,7 +1483,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
if (Right.Type == TT_UnaryOperator)
return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
(Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
- if (Left.isOneOf(tok::identifier, tok::greater, tok::r_square) &&
+ if ((Left.isOneOf(tok::identifier, tok::greater, tok::r_square) ||
+ Left.isSimpleTypeSpecifier()) &&
Right.is(tok::l_brace) && Right.getNextNonComment() &&
Right.BlockKind != BK_Block)
return false;
OpenPOWER on IntegriCloud