Commit 91392840 by Jason Merrill Committed by Jason Merrill

parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU noreturn attribute.

	* parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
	noreturn attribute.

From-SVN: r197555
parent f2e2de5f
2013-04-06 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
noreturn attribute.
2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net> 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
* parser.c (cp_parser_ref_qualifier_seq_opt): Move to * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
......
...@@ -20908,8 +20908,13 @@ cp_parser_std_attribute (cp_parser *parser) ...@@ -20908,8 +20908,13 @@ cp_parser_std_attribute (cp_parser *parser)
token = cp_lexer_peek_token (parser->lexer); token = cp_lexer_peek_token (parser->lexer);
} }
else else
{
attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id), attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id),
NULL_TREE); NULL_TREE);
/* C++11 noreturn attribute is equivalent to GNU's. */
if (is_attribute_p ("noreturn", attr_id))
TREE_PURPOSE (TREE_PURPOSE (attribute)) = get_identifier ("gnu");
}
/* Now parse the optional argument clause of the attribute. */ /* Now parse the optional argument clause of the attribute. */
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
// Test for syntax support of various attribute permutations. // Test for syntax support of various attribute permutations.
int int
[[gnu::noreturn]] // { dg-warning "ignored" } [[noreturn]] // { dg-warning "ignored" }
one one
[[gnu::unused]] [[gnu::unused]]
(void); (void);
int one_third [[gnu::noreturn]] [[gnu::unused]] (void); int one_third [[noreturn]] [[gnu::unused]] (void);
int [[gnu::unused]] one_half(); // { dg-warning "ignored" } int [[gnu::unused]] one_half(); // { dg-warning "ignored" }
static static
[[gnu::noreturn]] // { dg-warning "ignored" } [[noreturn]] // { dg-warning "ignored" }
void two [[gnu::unused]] (void) {} void two [[gnu::unused]] (void) {}
...@@ -21,10 +21,10 @@ void two [[gnu::unused]] (void) {} ...@@ -21,10 +21,10 @@ void two [[gnu::unused]] (void) {}
[[gnu::unused]] [[gnu::unused]]
int int
five(void) five(void)
[[gnu::noreturn]] // { dg-warning "ignored" } [[noreturn]] // { dg-warning "ignored" }
{} {}
[[gnu::noreturn]] [[noreturn]]
void void
six (void) six (void)
; ;
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