================
@@ -0,0 +1,36 @@
+// REQUIRES: spirv-registered-target
+// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 -triple spirv64
-Wno-unused-value %s
+
+// __spirv_event_t is an opaque type: it cannot be initialized from, converted
+// to, or cast from other types, nor used in arithmetic. It cannot be used in
+// constant evaluation.
+void foo() {
+ int n = 100;
+ __spirv_event_t v = 0; // expected-error {{cannot initialize a variable of
type '__spirv_event_t' with an rvalue of type 'int'}}
+ static_cast<__spirv_event_t>(n); // expected-error {{static_cast from 'int'
to '__spirv_event_t' is not allowed}}
----------------
AaronBallman wrote:
Missing test coverage in the other direction; `static_cast<int>(v)` should also
fail. But we should also ensure that `(void)v;` and similar work as expected.
https://github.com/llvm/llvm-project/pull/207077
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits