forked from OSchip/llvm-project
PR11148: Fix crash-on-invalid if an invalid member declaration is marked as
defaulted or deleted. llvm-svn: 144270
This commit is contained in:
parent
d010ba4729
commit
1c7047375a
|
@ -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)) {
|
||||
|
|
|
@ -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}}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue