]> granicus.if.org Git - clang/commitdiff
Add hasSameType overload to ASTContext for Type pointers. Switch a type
authorRichard Trieu <rtrieu@google.com>
Thu, 22 May 2014 01:39:16 +0000 (01:39 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 22 May 2014 01:39:16 +0000 (01:39 +0000)
comparison check to use this instead of calling Type::getCanonicalTypeInternal

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

include/clang/AST/ASTContext.h
lib/Sema/SemaOverload.cpp

index 1f97a4c6f0b12faac9fea3067d4252055919233c..7ca5da8862f99cba96437ad6252dd5926354f33e 100644 (file)
@@ -1778,6 +1778,10 @@ public:
     return getCanonicalType(T1) == getCanonicalType(T2);
   }
 
+  bool hasSameType(const Type *T1, const Type *T2) const {
+    return getCanonicalType(T1) == getCanonicalType(T2);
+  }
+
   /// \brief Return this type as a completely-unqualified array type,
   /// capturing the qualifiers in \p Quals.
   ///
index 3ea939f4cdc5dfb42fe2e11142ca6d529c47774d..3aca69244da785e3c5976f2ca206ce2c1c4b6fe2 100644 (file)
@@ -2526,8 +2526,7 @@ void Sema::HandleFunctionTypeMismatch(PartialDiagnostic &PDiag,
   if (FromType->isMemberPointerType() && ToType->isMemberPointerType()) {
     const MemberPointerType *FromMember = FromType->getAs<MemberPointerType>(),
                             *ToMember = ToType->getAs<MemberPointerType>();
-    if (FromMember->getClass()->getCanonicalTypeInternal() !=
-        ToMember->getClass()->getCanonicalTypeInternal()) {
+    if (!Context.hasSameType(FromMember->getClass(), ToMember->getClass())) {
       PDiag << ft_different_class << QualType(ToMember->getClass(), 0)
             << QualType(FromMember->getClass(), 0);
       return;