[Issue 20520] New: Runtime segfault when taking typeid of a class instanciated within an enum
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 20 15:04:50 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20520
Issue ID: 20520
Summary: Runtime segfault when taking typeid of a class
instanciated within an enum
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: cpicard at purrfect.fr
The following code segfaults at runtime. No warning is displayed during
compilation so I assume that the operation should be allowed.
class C {}
enum Foo {
Bar = new C()
}
void main() {
pragma(msg, typeid(Foo.Bar)); // Works fine: typeid(C())
auto t = typeid(Foo.Bar); // Segfault here
}
DMD64 D Compiler v2.090.0, no compilation flag necessary to replicate.
--
More information about the Digitalmars-d-bugs
mailing list