Commit 19e21586 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/67767 (-Wsuggest-attribute=noreturn suggests noreturn for function…

re PR c++/67767 (-Wsuggest-attribute=noreturn suggests noreturn for function which already has noreturn and cold.)

	PR c++/67767
	* parser.c (cp_parser_std_attribute_spec_seq): Don't assume
	attr_spec is always single element chain, chain all the attributes
	properly together in the right order.

	* g++.dg/cpp0x/pr67767.C: New test.

From-SVN: r233560
parent 2db16594
2016-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/67767
* parser.c (cp_parser_std_attribute_spec_seq): Don't assume
attr_spec is always single element chain, chain all the attributes
properly together in the right order.
2016-02-18 Jason Merrill <jason@redhat.com> 2016-02-18 Jason Merrill <jason@redhat.com>
* mangle.c (maybe_check_abi_tags): Add for_decl parm. Call * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
......
...@@ -24104,7 +24104,8 @@ cp_parser_std_attribute_spec (cp_parser *parser) ...@@ -24104,7 +24104,8 @@ cp_parser_std_attribute_spec (cp_parser *parser)
static tree static tree
cp_parser_std_attribute_spec_seq (cp_parser *parser) cp_parser_std_attribute_spec_seq (cp_parser *parser)
{ {
tree attr_specs = NULL; tree attr_specs = NULL_TREE;
tree attr_last = NULL_TREE;
while (true) while (true)
{ {
...@@ -24114,11 +24115,13 @@ cp_parser_std_attribute_spec_seq (cp_parser *parser) ...@@ -24114,11 +24115,13 @@ cp_parser_std_attribute_spec_seq (cp_parser *parser)
if (attr_spec == error_mark_node) if (attr_spec == error_mark_node)
return error_mark_node; return error_mark_node;
TREE_CHAIN (attr_spec) = attr_specs; if (attr_last)
attr_specs = attr_spec; TREE_CHAIN (attr_last) = attr_spec;
else
attr_specs = attr_last = attr_spec;
attr_last = tree_last (attr_last);
} }
attr_specs = nreverse (attr_specs);
return attr_specs; return attr_specs;
} }
2016-02-19 Jakub Jelinek <jakub@redhat.com>
PR c++/67767
* g++.dg/cpp0x/pr67767.C: New test.
2016-02-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2016-02-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* lib/target-supports.exp: Define aarch64_asm_FUNC_ok checks * lib/target-supports.exp: Define aarch64_asm_FUNC_ok checks
......
// PR c++/67767
// { dg-do compile { target c++11 } }
// { dg-options "-Wsuggest-attribute=noreturn" }
void foo [[gnu::cold, gnu::noreturn]] ();
void foo () // { dg-bogus "function might be candidate for attribute" }
{
throw 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment