+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>
* parser.c (cp_parser_ref_qualifier_seq_opt): Move to
token = cp_lexer_peek_token (parser->lexer);
}
else
- attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id),
- NULL_TREE);
+ {
+ attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id),
+ 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. */
// Test for syntax support of various attribute permutations.
int
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
one
[[gnu::unused]]
(void);
-int one_third [[gnu::noreturn]] [[gnu::unused]] (void);
+int one_third [[noreturn]] [[gnu::unused]] (void);
int [[gnu::unused]] one_half(); // { dg-warning "ignored" }
static
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
void two [[gnu::unused]] (void) {}
[[gnu::unused]]
int
five(void)
-[[gnu::noreturn]] // { dg-warning "ignored" }
+[[noreturn]] // { dg-warning "ignored" }
{}
-[[gnu::noreturn]]
+[[noreturn]]
void
six (void)
;