D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16981 - [Reg 2.073] assigning class or struct pointers to enum became an error
Summary: [Reg 2.073] assigning class or struct pointers to enum became an error
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 18:11 UTC by Martin Nowak
Modified: 2017-01-17 23:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2016-12-18 18:11:38 UTC
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 Martin Nowak 2016-12-18 18:12:33 UTC
Also see issue 11697.
Comment 2 Martin Nowak 2017-01-17 23:35:29 UTC
This was an uncatched error with undefined behavior beforehand, see issue 15989 and https://github.com/dlang/dmd/pull/6164.