summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-01 09:15:46 +0000
committerDaniel Jasper <djasper@google.com>2013-07-01 09:15:46 +0000
commit7f5d53e55fd8465209abc976fc8a6036f8138b8f (patch)
tree2ff0f7488a5e1dc64318b7f402700084c8e38cfd /clang/lib/Format/UnwrappedLineParser.cpp
parentc3832f7788db8df5930cd92ef22edfa204a3a9d0 (diff)
downloadbcm5719-llvm-7f5d53e55fd8465209abc976fc8a6036f8138b8f.tar.gz
bcm5719-llvm-7f5d53e55fd8465209abc976fc8a6036f8138b8f.zip
Fix braced-list detection in lieu of trailing comments.
Before: DoSomethingWithVector({ } /* No data */); After: DoSomethingWithVector({} /* No data */); llvm-svn: 185319
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 1c2a8fe4889..170c8926091 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -255,7 +255,12 @@ void UnwrappedLineParser::calculateBraceTypes() {
SmallVector<unsigned, 8> LBraceStack;
assert(Tok->Tok.is(tok::l_brace));
do {
- FormatToken *NextTok = Tokens->getNextToken();
+ // Get next none-comment token.
+ FormatToken *NextTok;
+ do {
+ NextTok = Tokens->getNextToken();
+ } while (NextTok->is(tok::comment));
+
switch (Tok->Tok.getKind()) {
case tok::l_brace:
LBraceStack.push_back(Position);
OpenPOWER on IntegriCloud