@@ -2907,7 +2907,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
29072907 return ExprError();
29082908 }
29092909
2910- if (MagnitudeTy.getCanonicalType() != SignTy.getCanonicalType( )) {
2910+ if (!Context.hasSameUnqualifiedType(MagnitudeTy, SignTy)) {
29112911 return Diag(Sign.get()->getBeginLoc(),
29122912 diag::err_typecheck_call_different_arg_types)
29132913 << MagnitudeTy << SignTy;
@@ -5265,7 +5265,7 @@ bool Sema::BuiltinComplex(CallExpr *TheCall) {
52655265
52665266 Expr *Real = TheCall->getArg(0);
52675267 Expr *Imag = TheCall->getArg(1);
5268- if (!Context.hasSameType (Real->getType(), Imag->getType())) {
5268+ if (!Context.hasSameUnqualifiedType (Real->getType(), Imag->getType())) {
52695269 return Diag(Real->getBeginLoc(),
52705270 diag::err_typecheck_call_different_arg_types)
52715271 << Real->getType() << Imag->getType()
@@ -15568,7 +15568,7 @@ Sema::BuiltinVectorMath(CallExpr *TheCall,
1556815568 if (checkMathBuiltinElementType(*this, LocA, TyA, ArgTyRestr, 1))
1556915569 return std::nullopt;
1557015570
15571- if (TyA.getCanonicalType() != TyB.getCanonicalType( )) {
15571+ if (!Context.hasSameUnqualifiedType(TyA, TyB)) {
1557215572 Diag(LocA, diag::err_typecheck_call_different_arg_types) << TyA << TyB;
1557315573 return std::nullopt;
1557415574 }
@@ -15607,8 +15607,8 @@ bool Sema::BuiltinElementwiseTernaryMath(
1560715607 }
1560815608
1560915609 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())) {
1561215612 return Diag(Args[0]->getBeginLoc(),
1561315613 diag::err_typecheck_call_different_arg_types)
1561415614 << Args[0]->getType() << Args[I]->getType();
0 commit comments