]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/attribs.cc
Implement C++17 [[maybe_unused]] attribute.
authorJason Merrill <jason@redhat.com>
Mon, 25 Apr 2016 17:21:49 +0000 (13:21 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 25 Apr 2016 17:21:49 +0000 (13:21 -0400)
commitd067e05f0e9a765e9ce60938aac1a1c99701cc33
tree264530e0fbdd09de1ee921078acbe9204f96ca60
parent4dfaa9631958d036d4de44ebfa5a1bcfa92462c4
Implement C++17 [[maybe_unused]] attribute.

gcc/
* attribs.c (register_scoped_attributes): Fix logic.
* attribs.h: Declare register_scoped_attributes.
c-family/
* c-common.c (handle_unused_attribute): Accept CONST_DECL.
No longer static.
* c-common.h: Declare it.
* c-lex.c (c_common_has_attribute): Add maybe_unused.
cp/
* tree.c (std_attribute_table): New.
(init_tree): Register it.

From-SVN: r235414
13 files changed:
gcc/ChangeLog
gcc/attribs.c
gcc/attribs.h
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-lex.c
gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/c-c++-common/attributes-enum-2.c
gcc/testsuite/c-c++-common/cpp/pr63831-1.c
gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
gcc/testsuite/g++.dg/cpp1z/maybe_unused1.C [new file with mode: 0644]