Add a new, more advanced CheckDerivedToBaseConversion that takes custom diagnostic IDs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71720 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp
index b832d38..bae69ac 100644
--- a/lib/Sema/SemaAccess.cpp
+++ b/lib/Sema/SemaAccess.cpp
@@ -46,7 +46,9 @@
 /// CheckBaseClassAccess - Check that a derived class can access its base class
 /// and report an error if it can't. [class.access.base]
 bool Sema::CheckBaseClassAccess(QualType Derived, QualType Base, 
-                                BasePaths& Paths, SourceLocation AccessLoc) {
+                                unsigned InaccessibleBaseID,
+                                BasePaths& Paths, SourceLocation AccessLoc,
+                                DeclarationName Name) {
   Base = Context.getCanonicalType(Base).getUnqualifiedType();
   assert(!Paths.isAmbiguous(Base) && 
          "Can't check base class access if set of paths is ambiguous");
@@ -101,8 +103,8 @@
   }
 
   if (InacessibleBase) {
-    Diag(AccessLoc, diag::err_conv_to_inaccessible_base) 
-      << Derived << Base;
+    Diag(AccessLoc, InaccessibleBaseID) 
+      << Derived << Base << Name;
 
     AccessSpecifier AS = InacessibleBase->getAccessSpecifierAsWritten();