From: Chris Lattner Date: Wed, 13 Feb 2008 18:01:07 +0000 (+0000) Subject: avoid making implicit casts that just remove typedefs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=438757c55f6d9f4042724a91fccd0d7ac908d5da;p=clang avoid making implicit casts that just remove typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47074 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/Sema.cpp b/Sema/Sema.cpp index ffa81a2736..ff8e182483 100644 --- a/Sema/Sema.cpp +++ b/Sema/Sema.cpp @@ -124,7 +124,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer) /// ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast. /// If there is already an implicit cast, merge into the existing one. void Sema::ImpCastExprToType(Expr *&Expr, QualType Type) { - if (Expr->getType() == Type) return; + if (Expr->getType().getCanonicalType() == Type.getCanonicalType()) return; if (ImplicitCastExpr *ImpCast = dyn_cast(Expr)) ImpCast->setType(Type);