[Issue 20520] Runtime segfault when taking typeid of a class instanciated within an enum

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 21 12:29:58 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=20520

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
I think that the operation should not be allowed. Doing `enum Bar = new C()`
results in "test.d(10): Error: variable `test.main.C` : Unable to initialize
enum with class or pointer to struct. Use static const variable instead.". I
assume this should outputted in the case of the bug report also.

--


More information about the Digitalmars-d-bugs mailing list