summaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2017-01-04 22:43:01 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2017-01-04 22:43:01 +0000
commit5465b0d08829d04fe61f7aa142707fc020d35062 (patch)
treedf77ec872827f76b5ee25d4aef865143c12c7694 /lib/Parse/ParseDecl.cpp
parentd3ccc219f93a26f30fb1866c69f29faf6f988a12 (diff)
[Parse] Don't ignore attributes after a late-parsed attr.
Without this, we drop everything after the first late-parsed attribute in a single __attribute__. (Where "drop" means "stuff everything into LA->Toks.") git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index ad40057473..ba24adefe6 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -177,8 +177,12 @@ void Parser::ParseGNUAttributes(ParsedAttributes &attrs,
if (!ClassStack.empty() && !LateAttrs->parseSoon())
getCurrentClass().LateParsedDeclarations.push_back(LA);
- // consume everything up to and including the matching right parens
- ConsumeAndStoreUntil(tok::r_paren, LA->Toks, true, false);
+ // Be sure ConsumeAndStoreUntil doesn't see the start l_paren, since it
+ // recursively consumes balanced parens.
+ LA->Toks.push_back(Tok);
+ ConsumeParen();
+ // Consume everything up to and including the matching right parens.
+ ConsumeAndStoreUntil(tok::r_paren, LA->Toks, /*StopAtSemi=*/true);
Token Eof;
Eof.startToken();