[cfe-commits] r122058 - /cfe/trunk/lib/Sema/SemaDecl.cpp
Abramo Bagnara
abramo.bagnara at gmail.com
Fri Dec 17 07:49:53 PST 2010
Author: abramo
Date: Fri Dec 17 09:49:53 2010
New Revision: 122058
URL: http://llvm.org/viewvc/llvm-project?rev=122058&view=rev
Log:
Use hasSameType to compare types for equality.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=122058&r1=122057&r2=122058&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Dec 17 09:49:53 2010
@@ -7745,7 +7745,8 @@
ECD->setInitVal(InitVal);
// Adjust the Expr initializer and type.
- if (ECD->getInitExpr() && NewTy != ECD->getInitExpr()->getType())
+ if (ECD->getInitExpr() &&
+ !Context.hasSameType(NewTy, ECD->getInitExpr()->getType()))
ECD->setInitExpr(ImplicitCastExpr::Create(Context, NewTy,
CK_IntegralCast,
ECD->getInitExpr(),
More information about the cfe-commits
mailing list