diff options
author | Marek Polacek <polacek@redhat.com> | 2019-06-19 21:27:45 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-06-19 21:27:45 +0000 |
commit | 1bf32c1141e230743f9248f7f7bf8aab91823df5 (patch) | |
tree | cf0c040fd768f2b12fa1f83eb56a3b2f9c9153ee /gcc/tree-inline.c | |
parent | 4b4a26731e96522a76a6f9fc6a253d41a29238ef (diff) | |
download | gcc-1bf32c1141e230743f9248f7f7bf8aab91823df5.zip gcc-1bf32c1141e230743f9248f7f7bf8aab91823df5.tar.gz gcc-1bf32c1141e230743f9248f7f7bf8aab91823df5.tar.bz2 |
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.
From-SVN: r272486
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 52f45a7..2de5e22 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -3899,7 +3899,7 @@ function_attribute_inlinable_p (const_tree fndecl) for (a = DECL_ATTRIBUTES (fndecl); a; a = TREE_CHAIN (a)) { - const_tree name = TREE_PURPOSE (a); + const_tree name = get_attribute_name (a); int i; for (i = 0; targetm.attribute_table[i].name != NULL; i++) |