aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-02-19 01:58:15 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2009-02-18 17:58:15 -0800
commit57c2231b2320835b96c6aeff3f2c76d165d4d47b (patch)
treef0aab9e1a84b567047db64e787d8293069ecdf3f
parent525dbc9afb9e6222511256af162d59370a5c6053 (diff)
downloadgcc-57c2231b2320835b96c6aeff3f2c76d165d4d47b.zip
gcc-57c2231b2320835b96c6aeff3f2c76d165d4d47b.tar.gz
gcc-57c2231b2320835b96c6aeff3f2c76d165d4d47b.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/parse/attr3.C14
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3ca03d3..709453d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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>
* cfns.h: Tweak pathname for cfns.gperf.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 404e45a..ead7d3a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -11916,6 +11916,7 @@ cp_parser_enum_specifier (cp_parser* parser)
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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0605ccb..bd0c95c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR testsuite/38165
diff --git a/gcc/testsuite/g++.dg/parse/attr3.C b/gcc/testsuite/g++.dg/parse/attr3.C
new file mode 100644
index 0000000..848df05
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/attr3.C
@@ -0,0 +1,14 @@
+// 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;
+}