diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-17 15:49:53 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-17 15:49:53 +0000 |
commit | 77815438d1a74f65bc23f0aeec96303106a171cf (patch) | |
tree | 7ae45d3fd980d9042490b5ac560e609efa1e0522 | |
parent | c950e77d1d0431b9fa9144e9ea7eaa858d8e032e (diff) | |
download | bcm5719-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.cpp | 3 |
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(), |