diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 902e80bd2426..8262260ae902 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -9151,6 +9151,12 @@ static bool IsInvalidCmseNSCallConversion(Sema &S, QualType FromType, // FIXME: add a couple examples in this comment. static Sema::AssignConvertType checkPointerTypesForAssignment(Sema &S, QualType LHSType, QualType RHSType) { + if (!LHSType.isCanonical()) + LHSType = LHSType.getCanonicalType(); + + if (!RHSType.isCanonical()) + RHSType = RHSType.getCanonicalType(); + assert(LHSType.isCanonical() && "LHS not canonicalized!"); assert(RHSType.isCanonical() && "RHS not canonicalized!");