gcc/testsuite/gdc.test/runnable/test15373.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=15373 |
| 2 | |
| 3 | // Using `typeid` on an `extern(C++) class` type is fine as it is evaluated at compile-time |
| 4 | |
| 5 | // Using `typeid` on an `extern(C++) class` instance is not ok because `extern(C++) class` |
| 6 | // instances are not rooted in `Object`. See test/fail_compilation/test15373.d |
| 7 | |
| 8 | extern(C++) class C |
| 9 | { } |
| 10 | |
| 11 | void main() |
| 12 | { |
| 13 | auto Cti = typeid(C); |
| 14 | assert(Cti.name == "test15373.C"); |
| 15 | } |