summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-22 09:00:33 +0000
committerDaniel Jasper <djasper@google.com>2014-05-22 09:00:33 +0000
commit3948516a03ba3405e2578d27fcaf898e58dc88b5 (patch)
treeec4165433a4d0f0296e231614e95a83f801d6790 /clang/lib/Format/Format.cpp
parent515ad8c490582d9b3b71274ed9255dc4a23c4610 (diff)
downloadbcm5719-llvm-3948516a03ba3405e2578d27fcaf898e58dc88b5.tar.gz
bcm5719-llvm-3948516a03ba3405e2578d27fcaf898e58dc88b5.zip
clang-format: Correctly identify multiplications in braces init lists.
Before: int i{a *b}; After: int i{a * b}; Also fix unrelated issue where braced init lists were counted as blocks and prevented single-line functions. llvm-svn: 209412
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 03177e586ad..471af1d5393 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -690,7 +690,7 @@ private:
if (I[1]->Last->Type == TT_LineComment)
return 0;
do {
- if (Tok->isOneOf(tok::l_brace, tok::r_brace) &&
+ if (Tok->is(tok::l_brace) && Tok->BlockKind != BK_BracedInit &&
!Style.AllowShortBlocksOnASingleLine)
return 0;
Tok = Tok->Next;
OpenPOWER on IntegriCloud