This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/47043] allow deprecating enum values


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=223527&root=gcc&view=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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]