[clang] [Clang] prevented assertion failure by handling integral to boolean conversions for boolean vectors (PR #108657)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 09:53:10 PDT 2024


================
@@ -51,6 +53,9 @@ static void test(void) {
     ivec4 -= ivec4;
     ivec4 |= ivec4;
     ivec4 += ptr; // expected-error {{cannot convert between vector and non-scalar values ('int4' (vector of 4 'int' values) and 'int *')}}
+
+    bvec4 != 0; // expected-warning {{inequality comparison result unused}} \
----------------
AaronBallman wrote:

Isn't the vector element type here `float` and not `bool`? (I'm trying to understand how the test case relates to the changes and feel like I must be missing something; perhaps the bool vector is from the result of the inequality operator?)

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


More information about the cfe-commits mailing list