summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-17 15:49:53 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-17 15:49:53 +0000
commit77815438d1a74f65bc23f0aeec96303106a171cf (patch)
tree7ae45d3fd980d9042490b5ac560e609efa1e0522
parentc950e77d1d0431b9fa9144e9ea7eaa858d8e032e (diff)
downloadbcm5719-llvm-77815438d1a74f65bc23f0aeec96303106a171cf.tar.gz
bcm5719-llvm-77815438d1a74f65bc23f0aeec96303106a171cf.zip
Use hasSameType to compare types for equality.
llvm-svn: 122058
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5fb5cbaa450..df7cb5065ee 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7745,7 +7745,8 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
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(),
OpenPOWER on IntegriCloud