Commit 57c2231b by H.J. Lu Committed by H.J. Lu

re PR c++/39219 (attribute doesn't work with enums properly)

gcc/cp

2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/39219
	* parser.c (cp_parser_enum_specifier): Apply all attributes.

gcc/testsuite/

2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/39219
	* g++.dg/parse/attr3.C: New.

From-SVN: r144284
parent 525dbc9a
2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39219
* parser.c (cp_parser_enum_specifier): Apply all attributes.
2009-02-18 Jason Merrill <jason@redhat.com> 2009-02-18 Jason Merrill <jason@redhat.com>
* cfns.h: Tweak pathname for cfns.gperf. * cfns.h: Tweak pathname for cfns.gperf.
......
...@@ -11916,6 +11916,7 @@ cp_parser_enum_specifier (cp_parser* parser) ...@@ -11916,6 +11916,7 @@ cp_parser_enum_specifier (cp_parser* parser)
if (cp_parser_allow_gnu_extensions_p (parser)) if (cp_parser_allow_gnu_extensions_p (parser))
{ {
tree trailing_attr = cp_parser_attributes_opt (parser); tree trailing_attr = cp_parser_attributes_opt (parser);
trailing_attr = chainon (trailing_attr, attributes);
cplus_decl_attributes (&type, cplus_decl_attributes (&type,
trailing_attr, trailing_attr,
(int) ATTR_FLAG_TYPE_IN_PLACE); (int) ATTR_FLAG_TYPE_IN_PLACE);
......
2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39219
* g++.dg/parse/attr3.C: New.
2009-02-18 Jack Howarth <howarth@bromo.med.uc.edu> 2009-02-18 Jack Howarth <howarth@bromo.med.uc.edu>
PR testsuite/38165 PR testsuite/38165
......
// PR c++/39219
enum __attribute__ ((deprecated)) E { e };
struct S { enum __attribute__ ((deprecated)) F { f = e }; };
int main () {
E x; // { dg-warning "'E' is deprecated" "" }
x = e;
S::F y; // { dg-warning "'F' is deprecated" "" }
y = S::f;
return x + y;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment