Issue a more descriptive diagnostics when mis-declaring
a destructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76436 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 88e027d..b9b2979 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -427,7 +427,8 @@
/// simple-template-id
///
Parser::TypeResult Parser::ParseClassName(SourceLocation &EndLocation,
- const CXXScopeSpec *SS) {
+ const CXXScopeSpec *SS,
+ bool DestrExpected) {
// Check whether we have a template-id that names a type.
if (Tok.is(tok::annot_template_id)) {
TemplateIdAnnotation *TemplateId
@@ -457,7 +458,8 @@
TypeTy *Type = Actions.getTypeName(*Tok.getIdentifierInfo(),
Tok.getLocation(), CurScope, SS);
if (!Type) {
- Diag(Tok, diag::err_expected_class_name);
+ Diag(Tok, DestrExpected ? diag::err_destructor_class_name
+ : diag::err_expected_class_name);
return true;
}