diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-28 09:13:41 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-12-28 09:13:41 +0000 |
commit | 4b0766f95883b7c5ffc1953f1d02d348f157c811 (patch) | |
tree | 1f5cb81afbabf2f875ec72146b8369e71cc11569 | |
parent | 6915c529dbb43073dad148c2e83a1c56bfcc05c8 (diff) |
Canonicalize types before possible cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122592 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index e2a6d34616..30d22dafc6 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -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; |