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 | 320e153dbce9c7f57f22a59e4d162795059717e5 (patch) | |
tree | 3c4578bbf7273d8e3147d4b250f009348766e5d4 | |
parent | bbca85d14c227641cb482ef497e1e567fe6f9c95 (diff) |
Use hasSameType to compare types for equality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122058 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 5fb5cbaa45..df7cb5065e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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(), |