PR c++/79817 - attribute deprecated on namespace.
authorMarek Polacek <polacek@redhat.com>
Fri, 23 Aug 2019 22:04:32 +0000 (22:04 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 23 Aug 2019 22:04:32 +0000 (22:04 +0000)
commit5857042a2b3dd635fc6cae214abd60d3a8336060
tree4d3f8bb0abb57d1a94a4245e00b078312eb47513
parentd0fc6e9f69b27fa93438c306fd9b25404982c2ea
PR c++/79817 - attribute deprecated on namespace.

* cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
* decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
(type_is_deprecated): Likewise.
* decl2.c (cp_warn_deprecated_use_scopes): New function.
* name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
* parser.c (cp_parser_namespace_alias_definition): Call
cp_warn_deprecated_use_scopes.
(cp_parser_using_declaration): Likewise.
(cp_parser_using_directive): Likewise.
* semantics.c (finish_id_expression_1): Likewise.

* g++.dg/cpp0x/attributes-namespace1.C: New test.
* g++.dg/cpp0x/attributes-namespace2.C: New test.
* g++.dg/cpp0x/attributes-namespace3.C: New test.
* g++.dg/cpp0x/attributes-namespace4.C: New test.
* g++.dg/cpp0x/attributes-namespace5.C: New test.
* g++.dg/cpp1z/namespace-attribs.C: Adjust.
* g++.dg/cpp1z/namespace-attribs2.C: Adjust.

From-SVN: r274888
15 files changed:
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/attributes-namespace1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/attributes-namespace2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/attributes-namespace3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/attributes-namespace4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/attributes-namespace5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/namespace-attribs.C
gcc/testsuite/g++.dg/cpp1z/namespace-attribs2.C