diff options
author | John McCall <rjmccall@apple.com> | 2010-03-17 00:38:33 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-17 00:38:33 +0000 |
commit | db7bb4a4e7d9744cbc994c90932e6f056228e1ff (patch) | |
tree | 589a856734356eea69c640b850113437cbb7f183 /lib/Parse/ParseDeclCXX.cpp | |
parent | 19b43e1ba9324cb08b730fa38d9be865e63771a2 (diff) |
Clean up after ourselves when there's an error parsing the base clause.
Fixes the crash-on-invalid in PR6629.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 11f84edcf1..9e232cbf32 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1520,6 +1520,9 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, if (!Tok.is(tok::l_brace)) { Diag(Tok, diag::err_expected_lbrace_after_base_specifiers); + + if (TagDecl) + Actions.ActOnTagDefinitionError(CurScope, TagDecl); return; } } @@ -1596,11 +1599,11 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, ParseLexedMethodDefs(getCurrentClass()); } + Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc); + // Leave the class scope. ParsingDef.Pop(); ClassScope.Exit(); - - Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc); } /// ParseConstructorInitializer - Parse a C++ constructor initializer, |