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

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 15 03:46:55 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);
----------------
c8ef wrote:

I believe this is similar to zero initializing a vector with 4 char elements.

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


More information about the cfe-commits mailing list