================
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -fms-extensions 
-verify %s
+
+// Test for issue (https://github.com/llvm/llvm-project/issues/222931).
+// Reject throwing/catching pointers and references whose pointee/referred type
+// has a non-default address space; runtimes don't yet support cross-address-
+// space conversions.
+
+using as1_int = int __attribute__((address_space(1)));
+using as1_int_ptr = int * __ptr32;
+
+void test_throw() {
+  throw (int * __ptr32)0; // expected-error {{cannot throw pointer with 
non-default address space}}
----------------
DavidSpickett wrote:

This does not produce an error on a 32-bit system: 
https://lab.llvm.org/buildbot/#/builders/154/builds/37509

I think that's expected so adding a 64-bit triple to this test is fine. That's 
what I'm going to do.

https://github.com/llvm/llvm-project/pull/224680
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to