From: Eli Friedman Date: Tue, 29 Jan 2008 07:51:12 +0000 (+0000) Subject: Use the canonical type when comparing array types so the comparison X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0493025c08da22b08af4f0587af726ae30251575;p=clang Use the canonical type when comparing array types so the comparison doesn't get confused by typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46502 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 7c089ee37b..9dd306944d 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -296,8 +296,8 @@ static bool areEquivalentArrayTypes(QualType NewQType, QualType OldQType) { if (hasUndefinedLength(NewAT) || hasUndefinedLength(OldAT)) { if (NewAT->getIndexTypeQualifier() != OldAT->getIndexTypeQualifier()) return false; - NewQType = NewAT->getElementType(); - OldQType = OldAT->getElementType(); + NewQType = NewAT->getElementType().getCanonicalType(); + OldQType = OldAT->getElementType().getCanonicalType(); } return NewQType == OldQType;