summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test15373.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/test15373.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/test15373.d22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15373.d b/gcc/testsuite/gdc.test/fail_compilation/test15373.d
new file mode 100644
index 00000000000..1b3cecd2d02
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/test15373.d
@@ -0,0 +1,22 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test15373.d(21): Error: Runtime type information is not supported for `extern(C++)` classes
+---
+*/
+
+// https://issues.dlang.org/show_bug.cgi?id=15373
+
+// Using `typeid` on an `extern(C++) class` type is ok as it is evaluated at compile-time
+// See test/runnable/test15373.d
+
+// Using `typeid` on an `extern(C++) class` instance is not ok because `extern(C++) class`
+// instances are not rooted in `Object`
+
+extern(C++) class C { }
+
+void foo()
+{
+ C c = new C();
+ auto ti = typeid(c);
+}