diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 21:35:42 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 21:35:42 +0000 |
commit | 985c6e3a7f5ac7ed72400d90fa5529c9370f61aa (patch) | |
tree | 7cac89ed01db35f3172a81cb7429efeb4d9798e7 /gcc/c-parser.c | |
parent | 985e7f1028ffb3c6e18d66e9c9ae8d0baaa3f74b (diff) | |
download | gcc-985c6e3a7f5ac7ed72400d90fa5529c9370f61aa.tar.gz |
* c-decl.c (shadow_tag_warned): Check for _Noreturn.
(quals_from_declspecs): Assert _Noreturn not present.
(grokdeclarator): Handle _Noreturn.
(build_null_declspecs): Initialize noreturn_p.
(declspecs_add_scspec): Handle RID_NORETURN.
* c-parser.c (c_token_starts_declspecs, c_parser_declspecs)
(c_parser_attributes): Handle RID_NORETURN.
* c-tree.h (struct c_declspecs): Add noreturn_p.
* ginclude/stdnoreturn.h: New.
* Makefile.in (USER_H): Add stdnoreturn.h.
c-family:
* c-common.c (c_common_reswords): Add _Noreturn.
(keyword_is_function_specifier): Handle RID_NORETURN.
* c-common.h (RID_NORETURN): New.
testsuite:
* gcc.dg/c1x-noreturn-1.c, gcc.dg/c1x-noreturn-2.c,
gcc.dg/c1x-noreturn-3.c, gcc.dg/c1x-noreturn-4.c,
gcc.dg/c1x-noreturn-5.c: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177881 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 0d2a1b7dfca..d0f8fba50ea 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -621,6 +621,7 @@ c_token_starts_declspecs (c_token *token) case RID_REGISTER: case RID_TYPEDEF: case RID_INLINE: + case RID_NORETURN: case RID_AUTO: case RID_THREAD: case RID_UNSIGNED: @@ -2080,12 +2081,13 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, case RID_REGISTER: case RID_TYPEDEF: case RID_INLINE: + case RID_NORETURN: case RID_AUTO: case RID_THREAD: if (!scspec_ok) goto out; attrs_ok = true; - /* TODO: Distinguish between function specifiers (inline) + /* TODO: Distinguish between function specifiers (inline, noreturn) and storage class specifiers, either here or in declspecs_add_scspec. */ declspecs_add_scspec (specs, c_parser_peek_token (parser)->value); @@ -3428,6 +3430,7 @@ c_parser_attributes (c_parser *parser) case RID_TYPEDEF: case RID_SHORT: case RID_INLINE: + case RID_NORETURN: case RID_VOLATILE: case RID_SIGNED: case RID_AUTO: |