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.
Also see issue 11697.
This was an uncatched error with undefined behavior beforehand, see issue 15989 and https://github.com/dlang/dmd/pull/6164.