@@ -2907,7 +2907,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
2907
2907
return ExprError();
2908
2908
}
2909
2909
2910
- if (MagnitudeTy.getCanonicalType() != SignTy.getCanonicalType( )) {
2910
+ if (!Context.hasSameUnqualifiedType(MagnitudeTy, SignTy)) {
2911
2911
return Diag(Sign.get()->getBeginLoc(),
2912
2912
diag::err_typecheck_call_different_arg_types)
2913
2913
<< MagnitudeTy << SignTy;
@@ -5265,7 +5265,7 @@ bool Sema::BuiltinComplex(CallExpr *TheCall) {
5265
5265
5266
5266
Expr *Real = TheCall->getArg(0);
5267
5267
Expr *Imag = TheCall->getArg(1);
5268
- if (!Context.hasSameType (Real->getType(), Imag->getType())) {
5268
+ if (!Context.hasSameUnqualifiedType (Real->getType(), Imag->getType())) {
5269
5269
return Diag(Real->getBeginLoc(),
5270
5270
diag::err_typecheck_call_different_arg_types)
5271
5271
<< Real->getType() << Imag->getType()
@@ -15568,7 +15568,7 @@ Sema::BuiltinVectorMath(CallExpr *TheCall,
15568
15568
if (checkMathBuiltinElementType(*this, LocA, TyA, ArgTyRestr, 1))
15569
15569
return std::nullopt;
15570
15570
15571
- if (TyA.getCanonicalType() != TyB.getCanonicalType( )) {
15571
+ if (!Context.hasSameUnqualifiedType(TyA, TyB)) {
15572
15572
Diag(LocA, diag::err_typecheck_call_different_arg_types) << TyA << TyB;
15573
15573
return std::nullopt;
15574
15574
}
@@ -15607,8 +15607,8 @@ bool Sema::BuiltinElementwiseTernaryMath(
15607
15607
}
15608
15608
15609
15609
for (int I = 1; I < 3; ++I) {
15610
- if (Args[0]->getType().getCanonicalType() !=
15611
- Args[I]->getType().getCanonicalType( )) {
15610
+ if (!Context.hasSameUnqualifiedType( Args[0]->getType(),
15611
+ Args[I]->getType())) {
15612
15612
return Diag(Args[0]->getBeginLoc(),
15613
15613
diag::err_typecheck_call_different_arg_types)
15614
15614
<< Args[0]->getType() << Args[I]->getType();
0 commit comments