------- Comment #2 from hjl dot tools at gmail dot com 2009-02-17 20:08 ------- cp_parser_enum_specifier ignores attributes unless they trailing attributes. But GNU extensions:
GNU Extensions: enum-key attributes[opt] identifier [opt] enum-base [opt] { enumerator-list [opt] }attributes[opt] allow attributes after enum-key. This patch works for me: --- cp/parser.c.foo 2009-02-05 09:56:53.000000000 -0800 +++ cp/parser.c 2009-02-17 12:07:45.000000000 -0800 @@ -11916,6 +11916,7 @@ cp_parser_enum_specifier (cp_parser* par if (cp_parser_allow_gnu_extensions_p (parser)) { tree trailing_attr = cp_parser_attributes_opt (parser); + trailing_attr = chainon (trailing_attr, attributes); cplus_decl_attributes (&type, trailing_attr, (int) ATTR_FLAG_TYPE_IN_PLACE); -- hjl dot tools at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-02-17 20:08:36 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219