Canonicalize types before possible cast.

llvm-svn: 122592
This commit is contained in:
Abramo Bagnara
2010-12-28 09:13:41 +00:00
parent 736a35d9ab
commit de85bd4f82

View File

@@ -4501,7 +4501,8 @@ static CastKind PrepareScalarCast(Sema &S, Expr *&Src, QualType DestTy) {
// Also, callers should have filtered out the invalid cases with
// pointers. Everything else should be possible.
QualType SrcTy = Src->getType();
QualType SrcTy = S.Context.getCanonicalType(Src->getType());
DestTy = S.Context.getCanonicalType(DestTy);
if (S.Context.hasSameUnqualifiedType(SrcTy, DestTy))
return CK_NoOp;