summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-01-30 04:05:15 +0000
committerNico Weber <nicolasweber@gmx.de>2015-01-30 04:05:15 +0000
commitd004586faa4383c0ce38da642bc1ce9d5500afc8 (patch)
treedff01c0505546db4420a31b567a4a9115cf82e2a /clang
parent07425af9202e8074d920116c1ea7a1a2f49bfd6c (diff)
downloadbcm5719-llvm-d004586faa4383c0ce38da642bc1ce9d5500afc8.tar.gz
bcm5719-llvm-d004586faa4383c0ce38da642bc1ce9d5500afc8.zip
Follow-up to r217302: Don't crash on ~A::A() if A is undeclared.
llvm-svn: 227555
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp3
-rw-r--r--clang/test/Parser/cxx-class.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 422b486c7b2..a753b0ff27a 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -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;
}
diff --git a/clang/test/Parser/cxx-class.cpp b/clang/test/Parser/cxx-class.cpp
index 9d68cd96b08..7c5c4ecf58c 100644
--- a/clang/test/Parser/cxx-class.cpp
+++ b/clang/test/Parser/cxx-class.cpp
@@ -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 {
OpenPOWER on IntegriCloud