aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-04-07 17:15:43 +0000
committerJason Merrill <jason@redhat.com>2013-04-07 17:15:43 +0000
commit8d519413557171f84f0aaf3409d296817e6664b4 (patch)
tree73ed35949809a3ca94bd3907ee1fee7e934538a0 /gcc/cp
parent8e750521c17772566f510d5e9d0254667fffad21 (diff)
* parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
noreturn attribute. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@197557 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3002ccf8242..39e83953850 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-06 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
+ noreturn attribute.
+
2013-04-03 Jason Merrill <jason@redhat.com>
* cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a32f1c3b0a7..ff1341a40a3 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -20806,8 +20806,13 @@ cp_parser_std_attribute (cp_parser *parser)
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. */