forked from OSchip/llvm-project
Follow-up to r217302: Don't crash on ~A::A() if A is undeclared.
llvm-svn: 227555
This commit is contained in:
parent
07425af920
commit
d004586faa
|
@ -2516,7 +2516,8 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
|
|||
}
|
||||
if (ParseOptionalCXXScopeSpecifier(SS, ObjectType, EnteringContext))
|
||||
return true;
|
||||
if (Tok.isNot(tok::identifier) || NextToken().is(tok::coloncolon)) {
|
||||
if (Tok.isNot(tok::identifier) || NextToken().is(tok::coloncolon) ||
|
||||
SS.isInvalid()) {
|
||||
Diag(TildeLoc, diag::err_destructor_tilde_scope);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -157,6 +157,8 @@ namespace DtorErrors {
|
|||
|
||||
struct D { struct X {}; ~D() throw(X); };
|
||||
~D::D() throw(X) {} // expected-error {{'~' in destructor name should be after nested name specifier}}
|
||||
|
||||
~Undeclared::Undeclared() {} // expected-error {{use of undeclared identifier 'Undeclared'}} expected-error {{'~' in destructor name should be after nested name specifier}}
|
||||
}
|
||||
|
||||
namespace BadFriend {
|
||||
|
|
Loading…
Reference in New Issue