[clang] [clang] Improve diagnostics for vector builtins (PR #125673)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 18 07:11:24 PDT 2025


================
@@ -12519,16 +12519,13 @@ def err_builtin_is_within_lifetime_invalid_arg : Error<
   "%select{non-|function }0pointer argument to '__builtin_is_within_lifetime' "
   "is not allowed">;
 
-def err_builtin_invalid_arg_type: Error <
-  "%ordinal0 argument must be "
-  "%select{a vector, integer or floating point type|a matrix|"
-  "a pointer to a valid matrix element type|"
-  "a signed integer or floating point type|a vector type|"
-  "a floating point type|"
-  "a vector of integers|"
-  "an unsigned integer|"
-  "an 'int'|"
-  "a vector of floating points}1 (was %2)">;
+def err_builtin_invalid_arg_type: Error<
+  "%ordinal0 argument must be a"
+  "%select{| scalar| vector| matrix| vector,| vector of| scalar or vector of}1"
+  "%select{| integer| signed integer| unsigned integer| 'int'|"
----------------
frasercrmck wrote:

Thanks for the review. I've pushed the version I outlined above but included detailed comments around each component, to hopefully help. I can revert this latest commit if desired.

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


More information about the cfe-commits mailing list