Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit b1ac4f7

Browse files
committed
Add hasSameType overload to ASTContext for Type pointers. Switch a type
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
1 parent 9fefd02 commit b1ac4f7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

include/clang/AST/ASTContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
17781778
return getCanonicalType(T1) == getCanonicalType(T2);
17791779
}
17801780

1781+
bool hasSameType(const Type *T1, const Type *T2) const {
1782+
return getCanonicalType(T1) == getCanonicalType(T2);
1783+
}
1784+
17811785
/// \brief Return this type as a completely-unqualified array type,
17821786
/// capturing the qualifiers in \p Quals.
17831787
///

lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,8 +2526,7 @@ void Sema::HandleFunctionTypeMismatch(PartialDiagnostic &PDiag,
25262526
if (FromType->isMemberPointerType() && ToType->isMemberPointerType()) {
25272527
const MemberPointerType *FromMember = FromType->getAs<MemberPointerType>(),
25282528
*ToMember = ToType->getAs<MemberPointerType>();
2529-
if (FromMember->getClass()->getCanonicalTypeInternal() !=
2530-
ToMember->getClass()->getCanonicalTypeInternal()) {
2529+
if (!Context.hasSameType(FromMember->getClass(), ToMember->getClass())) {
25312530
PDiag << ft_different_class << QualType(ToMember->getClass(), 0)
25322531
<< QualType(FromMember->getClass(), 0);
25332532
return;

0 commit comments

Comments
 (0)