[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 1 09:46:21 PDT 2024


Pol Marcet =?utf-8?q?Sardà?= <polmarcetsarda at gmail.com>,
Pol Marcet =?utf-8?q?Sardà?= <polmarcetsarda at gmail.com>,
Pol Marcet =?utf-8?q?Sardà?= <polmarcetsarda at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/76615 at github.com>


================
@@ -10318,6 +10318,8 @@ def err_shufflevector_nonconstant_argument : Error<
 def err_shufflevector_argument_too_large : Error<
   "index for __builtin_shufflevector must be less than the total number "
   "of vector elements">;
+def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error<
+  "index for __builtin_shufflevector must be within the bounds of the input vectors in a constexpr context. An index of -1 at position %0 was found. -1 is only allowed at runtime.">;
----------------
erichkeane wrote:

```suggestion
  "index for __builtin_shufflevector not within the bounds of the input vectors; index of -1 found at position %0 not permitted in a constexpr context">;
```

Leave the 'only allowed at runtime' for the documentation (and document it?).

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


More information about the cfe-commits mailing list