[Parse] Don't crash on ~A::{

Found by clang-fuzz.

llvm-svn: 233492
This commit is contained in:
Benjamin Kramer 2015-03-29 14:35:39 +00:00
parent 8671028e95
commit 3012e59bc7
2 changed files with 2 additions and 1 deletions

View File

@ -2535,7 +2535,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
if (SS.isNotEmpty())
ObjectType = ParsedType();
if (Tok.isNot(tok::identifier) || NextToken().is(tok::coloncolon) ||
SS.isInvalid()) {
!SS.isSet()) {
Diag(TildeLoc, diag::err_destructor_tilde_scope);
return true;
}

View File

@ -159,6 +159,7 @@ namespace DtorErrors {
~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}}
~Undeclared:: {} // expected-error {{expected identifier}} expected-error {{'~' in destructor name should be after nested name specifier}}
struct S {
// For another struct's destructor, emit the same diagnostic like for