PR11148: Fix crash-on-invalid if an invalid member declaration is marked as

defaulted or deleted.

llvm-svn: 144270
This commit is contained in:
Richard Smith 2011-11-10 09:08:44 +00:00
parent d010ba4729
commit 1c7047375a
2 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,11 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
if (Tok.is(tok::equal)) {
ConsumeToken();
if (!FnD) {
SkipUntil(tok::semi);
return 0;
}
bool Delete = false;
SourceLocation KWLoc;
if (Tok.is(tok::kw_delete)) {

View File

@ -13,3 +13,7 @@ struct foo {
};
void baz() = delete;
struct quux {
int quux() = default; // expected-error{{constructor cannot have a return type}} expected-error {{member 'quux' has the same name as its class}}
};