diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-12 18:53:33 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-12 18:53:33 +0000 |
commit | 89868e450153621895a3d0706389f1a72343d0c9 (patch) | |
tree | 8fc6633efbe1c9993cf1d8cb8bb403fd0fd330bd /gcc/c/c-parser.c | |
parent | 86c7212c03c4f396d098da0d20d7a3a86e3cf6a1 (diff) | |
download | gcc-89868e450153621895a3d0706389f1a72343d0c9.tar.gz |
* c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
Add pedwarn.
(c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
Likewise.
(c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
* gcc.dg/concat.c: Add dg-options.
* gcc.dg/func-outside-2.c: Add __extension__.
* gcc.dg/pr19967.c: Use -std=c99.
* gcc.dg/pr22458-1.c: Add dg-options.
* gcc.dg/pr33676.c: Add dg-options.
* gcc.dg/gnu-predef-1.c: New test.
* gcc.dg/c90-func-1.c: New test.
* gcc.dg/c90-func-2.c: New test.
* gcc.dg/c90-func-2.h: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index ca8577cd63a..5f23379df8f 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -7136,8 +7136,24 @@ c_parser_postfix_expression (c_parser *parser) switch (c_parser_peek_token (parser)->keyword) { case RID_FUNCTION_NAME: + pedwarn (loc, OPT_Wpedantic, "ISO C does not support " + "%<__FUNCTION__%> predefined identifier"); + expr.value = fname_decl (loc, + c_parser_peek_token (parser)->keyword, + c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + break; case RID_PRETTY_FUNCTION_NAME: + pedwarn (loc, OPT_Wpedantic, "ISO C does not support " + "%<__PRETTY_FUNCTION__%> predefined identifier"); + expr.value = fname_decl (loc, + c_parser_peek_token (parser)->keyword, + c_parser_peek_token (parser)->value); + c_parser_consume_token (parser); + break; case RID_C99_FUNCTION_NAME: + pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support " + "%<__func__%> predefined identifier"); expr.value = fname_decl (loc, c_parser_peek_token (parser)->keyword, c_parser_peek_token (parser)->value); |