Bug 16981 – [Reg 2.073] assigning class or struct pointers to enum became an error

Status
RESOLVED
Resolution
WONTFIX
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-12-18T18:11:00Z
Last change time
2017-01-17T23:35:29Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2016-12-18T18:11:38Z
cat > bug.d << CODE void bug() { import std.regex : ctRegex; enum te = ctRegex!("a"); } CODE dmd -c -o- bug ---- bug.d(4): Error: variable bug.bug.te : Unable to initialize enum with class or pointer to struct. Use static const variable instead. ---- Works without deprecation in 2.072.1.
Comment #1 by code — 2016-12-18T18:12:33Z
Also see issue 11697.
Comment #2 by code — 2017-01-17T23:35:29Z
This was an uncatched error with undefined behavior beforehand, see issue 15989 and https://github.com/dlang/dmd/pull/6164.