https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127394
Bug ID: 127394
Summary: Incorrect warning for nodiscard with enum type
specifier
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: luigighiron at gmail dot com
Target Milestone: ---
The following code incorrectly generates a -Wattributes warning:
enum[[nodiscard]]E:int{e};
If the enum type specifier :int is removed, no warning is generated. No warning
is generated when compiling in C++ instead.