https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117115
Bug ID: 117115
Summary: [14/15 regression]: ICE in expand_d_format when
diagnosing an empty enum declaration
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: a.horodniceanu at proton dot me
Target Milestone: ---
The following code causes an ICE since
964fd402c9b48eb4da91fb3e4e45d4560d6c676c:
------
module object;
enum Foo {}
------
-------
$ /usr/x86_64-pc-linux-gnu/gcc-bin/14/gdc repro.d -freport-bug
d21: internal compiler error: in expand_d_format, at d/d-diagnostic.cc:127
Please submit a full bug report, with preprocessed source.
See <https://bugs.gentoo.org/> for instructions.
-------
gdc-13 works:
-------
$ /usr/x86_64-pc-linux-gnu/gcc-bin/13/gdc repro.d
repro.d:2:1: error: enum ‘object.Foo’ enum ‘Foo’ must have at least one member
2 | enum Foo {}
| ^
-------
And so do dmd and ldc2.