]> granicus.if.org Git - clang/commitdiff
avoid making implicit casts that just remove typedefs.
authorChris Lattner <sabre@nondot.org>
Wed, 13 Feb 2008 18:01:07 +0000 (18:01 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 Feb 2008 18:01:07 +0000 (18:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47074 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/Sema.cpp

index ffa81a2736e6b96cf96f27937d97c1d31b1515ee..ff8e18248314422723376467f73e774080f45264 100644 (file)
@@ -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<ImplicitCastExpr>(Expr))
     ImpCast->setType(Type);