[Bug c/47043] allow deprecating enum values

2015-05-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043

--- Comment #4 from Marek Polacek mpolacek at gcc dot gnu.org ---
Author: mpolacek
Date: Fri May 22 09:07:31 2015
New Revision: 223527

URL: https://gcc.gnu.org/viewcvs?rev=223527root=gccview=rev
Log:
PR c/47043
* c-common.c (handle_deprecated_attribute): Allow CONST_DECL.

* c-parser.c (c_parser_enum_specifier): Parse and apply enumerator
attributes.

* cp-tree.h (build_enumerator): Update declaration.
* decl.c (build_enumerator): Add attributes parameter.  Call
cplus_decl_attributes.
* init.c (constant_value_1): Pass tf_none to mark_used.
* parser.c (cp_parser_enumerator_definition): Parse attributes and
pass them down to build_enumerator.
* pt.c (tsubst_enum): Pass decl attributes to build_enumerator.
* semantics.c (finish_id_expression): Don't warn_deprecated_use here.

* doc/extend.texi (Enumerator Attributes): New section.
Document syntax of enumerator attributes.

* c-c++-common/attributes-enum-1.c: New test.
* c-c++-common/attributes-enum-2.c: New test.
* g++.dg/cpp0x/attributes-enum-1.C: New test.
* g++.dg/cpp1y/attributes-enum-1.C: New test.

Added:
trunk/gcc/testsuite/c-c++-common/attributes-enum-1.c
trunk/gcc/testsuite/c-c++-common/attributes-enum-2.c
trunk/gcc/testsuite/g++.dg/cpp0x/attributes-enum-1.C
trunk/gcc/testsuite/g++.dg/cpp1y/attributes-enum-1.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-parser.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/ChangeLog


[Bug c/47043] allow deprecating enum values

2015-05-22 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Marek Polacek mpolacek at gcc dot gnu.org ---
Done.


[Bug c/47043] allow deprecating enum values

2015-04-30 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
   Target Milestone|--- |6.0


[Bug c/47043] allow deprecating enum values

2013-01-05 Thread bangerth at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043



Wolfgang Bangerth bangerth at gmail dot com changed:



   What|Removed |Added



 CC||joseph.h.garvin at gmail

   ||dot com



--- Comment #2 from Wolfgang Bangerth bangerth at gmail dot com 2013-01-05 
23:31:11 UTC ---

*** Bug 45168 has been marked as a duplicate of this bug. ***


[Bug c/47043] allow deprecating enum values

2013-01-05 Thread bangerth at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043



Wolfgang Bangerth bangerth at gmail dot com changed:



   What|Removed |Added



 CC||bangerth at gmail dot com



--- Comment #3 from Wolfgang Bangerth bangerth at gmail dot com 2013-01-05 
23:32:04 UTC ---

Indeed a good idea -- I'm missing it too. For the record, clang++ accepts the

code.


[Bug c/47043] allow deprecating enum values

2010-12-22 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47043

Steven Bosscher steven at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.12.22 18:34:01
 CC||steven at gcc dot gnu.org
 Ever Confirmed|0   |1

--- Comment #1 from Steven Bosscher steven at gcc dot gnu.org 2010-12-22 
18:34:01 UTC ---
Interesting idea.