[clang] [Clang][Sema] Improve shuffle vector size mismatch diagnostic (PR #223768)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 11:13:56 PDT 2026


================
@@ -6603,7 +6603,7 @@ ExprResult Sema::BuiltinShuffleVector(CallExpr *TheCall) {
 
       if (RHSVecType->getNumElements() != NumElements)
         return ExprError(Diag(TheCall->getBeginLoc(),
-                              diag::err_vec_builtin_incompatible_vector)
+                              diag::err_shufflevector_incompatible_vector)
----------------
jhuber6 wrote:

Could we use 'err_typecheck_vector_lengths_not_equal'? Would probably look like:
```
  error: vector operands do not have the same number of elements ('v8b' (vector of 8 'bool' values) and 'v6i' (vector of 6 'int' values))
```
I generally favor re-using stuff, this doesn't say the name of the function but it should still point to it in the diagnostic.

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


More information about the cfe-commits mailing list