| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/test15373.d(21): Error: runtime type information is not supported for `extern(C++)` classes |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
// https://issues.dlang.org/show_bug.cgi?id=15373 |
| 9 |
|
| 10 |
// Using `typeid` on an `extern(C++) class` type is ok as it is evaluated at compile-time |
| 11 |
// See test/runnable/test15373.d |
| 12 |
|
| 13 |
// Using `typeid` on an `extern(C++) class` instance is not ok because `extern(C++) class` |
| 14 |
// instances are not rooted in `Object` |
| 15 |
|
| 16 |
extern(C++) class C { } |
| 17 |
|
| 18 |
void foo() |
| 19 |
{ |
| 20 |
C c = new C(); |
| 21 |
auto ti = typeid(c); |
| 22 |
} |