[clang] [Clang] Permit implicit conversion from integral to boolean vectors (PR #158369)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 17 17:59:44 PDT 2025


================
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -triple x86_64 -fsyntax-only -verify %s
+
+typedef _Bool bool;
+
+typedef __attribute__((ext_vector_type(8))) int v8i;
+typedef __attribute__((ext_vector_type(8))) bool v8b;
+typedef __attribute__((ext_vector_type(4))) float v4f;
+typedef __attribute__((ext_vector_type(4))) bool v4b;
+
+void foo(v8b);
+
+v8b integral(v8i v) {
+  v8b m1 = __builtin_convertvector(v, __attribute__((ext_vector_type(8))) int);
----------------
shafik wrote:

I think it would good to show that these are still narrowing conversions in C++. I did not see any tests that cover this anywhere else.

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


More information about the cfe-commits mailing list