[clang] [clang] Update typechecking of builtin elementwise ternary math operators (PR #155620)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 27 17:50:31 PDT 2025


================
@@ -15948,17 +15998,12 @@ bool Sema::BuiltinElementwiseTernaryMath(
       return true;
   }
 
-  TheCall->setArg(0, Args[0]);
-  for (int I = 1; I < 3; ++I) {
-    if (Args[0]->getType().getCanonicalType() !=
-        Args[I]->getType().getCanonicalType()) {
-      return Diag(Args[0]->getBeginLoc(),
-                  diag::err_typecheck_call_different_arg_types)
-             << Args[0]->getType() << Args[I]->getType();
-    }
+  if (checkBuiltinVectorMathArgTypes(*this, 3, Args)) {
+    return true;
+  }
----------------
Sirraide wrote:

```suggestion
  if (checkBuiltinVectorMathArgTypes(*this, 3, Args))
    return true;
```

https://github.com/llvm/llvm-project/pull/155620


More information about the cfe-commits mailing list