diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2017-01-04 22:43:01 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2017-01-04 22:43:01 +0000 |
commit | c8b9537f75250eb1be7ddf89ab0dba99ce3a0e1a (patch) | |
tree | d8494b9703c8dd60fed55a2a422edb615ee3eac3 /clang/lib | |
parent | cb0d4df97490ec2d2b1cdf7574d26b1bc4063599 (diff) | |
download | bcm5719-llvm-c8b9537f75250eb1be7ddf89ab0dba99ce3a0e1a.tar.gz bcm5719-llvm-c8b9537f75250eb1be7ddf89ab0dba99ce3a0e1a.zip |
[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.")
llvm-svn: 291020
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index ad400574731..ba24adefe6b 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/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(); |