[clang] [clang] constexpr built-in reduce add function. (PR #116243)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 15 02:23:36 PST 2024


================
@@ -723,3 +723,9 @@ not within the bounds of the input vectors; index of -1 found at position 0 is n
 permitted in a constexpr context}}
         vector4charConst1,
         vector4charConst2, -1, -1, -1, -1);
+
+static_assert(__builtin_reduce_add((vector4char){}) == 0);
----------------
RKSimon wrote:

How is this handled? I'd have expected `Source.getVectorElt(0).getInt()` to have failed?

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


More information about the cfe-commits mailing list