From 77815438d1a74f65bc23f0aeec96303106a171cf Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Fri, 17 Dec 2010 15:49:53 +0000 Subject: [PATCH] Use hasSameType to compare types for equality. llvm-svn: 122058 --- clang/lib/Sema/SemaDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5fb5cbaa4508..df7cb5065eed 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(), -- GitLab