]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/60364 - noreturn after first decl not diagnosed.
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2019 21:27:45 +0000 (21:27 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Jun 2019 21:27:45 +0000 (21:27 +0000)
commite7b53e8cc78bcfa388a030967667cddb74a6785c
treecf0c040fd768f2b12fa1f83eb56a3b2f9c9153ee
parent93f1dca1641262329f82707c719250c1fa69fc6a
PR c++/60364 - noreturn after first decl not diagnosed.
* attribs.c (get_attribute_namespace): No longer static.
(decl_attributes): Avoid shadowing.  Preserve the C++11 form for C++11
attributes.
(attr_noreturn_exclusions): Make it extern.
* attribs.h (get_attribute_namespace): Declare.
* tree-inline.c (function_attribute_inlinable_p): Use
get_attribute_name.

* c-attribs.c (handle_noreturn_attribute): No longer static.
* c-common.h (handle_noreturn_attribute, attr_noreturn_exclusions):
Declare.
* c-format.c (check_function_format): Use get_attribute_name.

* decl.c (duplicate_decls): Give an error when a function is
declared [[noreturn]] after its first declaration.
* parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
attribute as equivalent to GNU's.
* tree.c (std_attribute_table): Add noreturn.

* g++.dg/warn/noreturn-8.C: New test.
* g++.dg/warn/noreturn-9.C: New test.
* g++.dg/warn/noreturn-10.C: New test.
* g++.dg/warn/noreturn-11.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272486 138bc75d-0d04-0410-961f-82ee72b054a4
17 files changed:
gcc/ChangeLog
gcc/attribs.c
gcc/attribs.h
gcc/c-family/ChangeLog
gcc/c-family/c-attribs.c
gcc/c-family/c-common.h
gcc/c-family/c-format.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/noreturn-10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/noreturn-11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/noreturn-8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/noreturn-9.C [new file with mode: 0644]
gcc/tree-inline.c