diff options
| author | Daniel Jasper <djasper@google.com> | 2013-07-01 09:15:46 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-07-01 09:15:46 +0000 |
| commit | 02eacc2cf85fe11577bf6ff20f6c203e87147c57 (patch) | |
| tree | c8eba18c5393d96e3927cd205311beb43c189915 /lib/Format/UnwrappedLineParser.cpp | |
| parent | fcd0aa1ae9068f6762661b7e954e7c558eafe613 (diff) | |
| download | clang-02eacc2cf85fe11577bf6ff20f6c203e87147c57.tar.gz clang-02eacc2cf85fe11577bf6ff20f6c203e87147c57.tar.bz2 clang-02eacc2cf85fe11577bf6ff20f6c203e87147c57.tar.xz | |
Fix braced-list detection in lieu of trailing comments.
Before:
DoSomethingWithVector({
} /* No data */);
After:
DoSomethingWithVector({} /* No data */);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
| -rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 1c2a8fe488..170c892609 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/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); |
