diff options
author | John McCall <rjmccall@apple.com> | 2010-05-28 08:11:17 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-28 08:11:17 +0000 |
commit | 08bede4c7b26416572dd49d1d8b60f62ba38b49e (patch) | |
tree | de0a3668f835b13b5bb1d6d5044bf8336cb73ede /clang/lib/Parse/ParseDeclCXX.cpp | |
parent | cd4b3ba3162c144684d5090e99c6bd7e89dd2d71 (diff) | |
download | bcm5719-llvm-08bede4c7b26416572dd49d1d8b60f62ba38b49e.tar.gz bcm5719-llvm-08bede4c7b26416572dd49d1d8b60f62ba38b49e.zip |
Don't just skip over the entire tag definition if the parser action didn't
give us a decl back. Makes -cc1 -parse-noop handle a substantially larger
amount of the C++ grammar.
llvm-svn: 104940
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 479c04c37d7..ce6147ae894 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1544,12 +1544,8 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation LBraceLoc = ConsumeBrace(); - if (!TagDecl) { - SkipUntil(tok::r_brace, false, false); - return; - } - - Actions.ActOnStartCXXMemberDeclarations(CurScope, TagDecl, LBraceLoc); + if (TagDecl) + Actions.ActOnStartCXXMemberDeclarations(CurScope, TagDecl, LBraceLoc); // C++ 11p3: Members of a class defined with the keyword class are private // by default. Members of a class defined with the keywords struct or union @@ -1594,9 +1590,10 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, if (Tok.is(tok::kw___attribute)) AttrList.reset(ParseGNUAttributes()); - Actions.ActOnFinishCXXMemberSpecification(CurScope, RecordLoc, TagDecl, - LBraceLoc, RBraceLoc, - AttrList.get()); + if (TagDecl) + Actions.ActOnFinishCXXMemberSpecification(CurScope, RecordLoc, TagDecl, + LBraceLoc, RBraceLoc, + AttrList.get()); // C++ 9.2p2: Within the class member-specification, the class is regarded as // complete within function bodies, default arguments, @@ -1613,7 +1610,8 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, ParseLexedMethodDefs(getCurrentClass()); } - Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc); + if (TagDecl) + Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc); // Leave the class scope. ParsingDef.Pop(); |