summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index e2a6d346164..30d22dafc67 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud