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
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,
ParseLexedMethodDefs(getCurrentClass());
}
- Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
+ if (TagDecl)
+ Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
// Leave the class scope.
ParsingDef.Pop();