]> granicus.if.org Git - clang/commitdiff
Canonicalize types before possible cast.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Tue, 28 Dec 2010 09:13:41 +0000 (09:13 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Tue, 28 Dec 2010 09:13:41 +0000 (09:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122592 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index e2a6d3461640a6f8326ff967b7158a05d38bd648..30d22dafc67b1ced86b9e5d6f1c5d9eb438abd63 100644 (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;