]> granicus.if.org Git - clang/commitdiff
Better diagnostic on deleted constructor when no
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 25 Nov 2009 21:53:11 +0000 (21:53 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 25 Nov 2009 21:53:11 +0000 (21:53 +0000)
initializer name is available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89885 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp

index 5f66d2515a8c702ce40da11684e35aa6581ff06c..ef59ff9d730d497349becb576a24fd89720d8d1e 100644 (file)
@@ -3611,10 +3611,13 @@ Sema::PerformInitializationByConstructor(QualType ClassType,
       Diag(Loc, diag::err_ovl_deleted_init)
         << Best->Function->isDeleted()
         << InitEntity << Range;
-    else
+    else {
+      const CXXRecordDecl *RD =
+          cast<CXXRecordDecl>(ClassType->getAs<RecordType>()->getDecl());
       Diag(Loc, diag::err_ovl_deleted_init)
         << Best->Function->isDeleted()
-        << InitEntity << Range;
+        << RD->getDeclName() << Range;
+    }
     PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/true);
     return 0;
   }