From: Chris Lattner Date: Mon, 29 Oct 2007 05:15:40 +0000 (+0000) Subject: when checking for type equality, ignore typedefs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84d35ce5c32a51113913adc684c6d825020b03e9;p=clang when checking for type equality, ignore typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43441 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 88a72eb982..36112e6488 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -1028,8 +1028,8 @@ Sema::CheckPointerTypesForAssignment(QualType lhsType, QualType rhsType) { /// Sema::AssignmentCheckResult Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) { - if (lhsType == rhsType) // common case, fast path... - return Compatible; + if (lhsType.getCanonicalType() == rhsType.getCanonicalType()) + return Compatible; // common case, fast path... if (lhsType->isReferenceType() || rhsType->isReferenceType()) { if (Context.referenceTypesAreCompatible(lhsType, rhsType))