Add a CK_DerivedToBaseMemberPointer cast kind and use it in Sema (Still no codegen).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85552 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index bf39604..8bb3348 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -83,7 +83,8 @@
 static TryCastResult TryStaticMemberPointerUpcast(Sema &Self, QualType SrcType,
                                                   QualType DestType,bool CStyle,
                                                   const SourceRange &OpRange,
-                                                  unsigned &msg);
+                                                  unsigned &msg,
+                                                  CastExpr::CastKind &Kind);
 static TryCastResult TryStaticImplicitCast(Sema &Self, Expr *SrcExpr,
                                            QualType DestType, bool CStyle,
                                            const SourceRange &OpRange,
@@ -480,7 +481,7 @@
   // conversion. C++ 5.2.9p9 has additional information.
   // DR54's access restrictions apply here also.
   tcr = TryStaticMemberPointerUpcast(Self, SrcType, DestType, CStyle,
-                                     OpRange, msg);
+                                     OpRange, msg, Kind);
   if (tcr != TC_NotApplicable)
     return tcr;
 
@@ -706,7 +707,7 @@
 TryCastResult
 TryStaticMemberPointerUpcast(Sema &Self, QualType SrcType, QualType DestType,
                              bool CStyle, const SourceRange &OpRange,
-                             unsigned &msg) {
+                             unsigned &msg, CastExpr::CastKind &Kind) {
   const MemberPointerType *DestMemPtr = DestType->getAs<MemberPointerType>();
   if (!DestMemPtr)
     return TC_NotApplicable;
@@ -760,6 +761,7 @@
     return TC_Failed;
   }
 
+  Kind = CastExpr::CK_DerivedToBaseMemberPointer;
   return TC_Success;
 }