diff options
author | Martin Sebor <msebor@redhat.com> | 2016-06-19 16:10:04 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2016-06-19 10:10:04 -0600 |
commit | aa0db437bce053c3e9fe55ad422b0807aad8b290 (patch) | |
tree | d4cf7b762145a93108c8bef3afb532ccb90ebbee /gcc/c/c-parser.c | |
parent | d42844f1fadda7cb8bf37a104d57f4f0e0302a1f (diff) | |
download | gcc-aa0db437bce053c3e9fe55ad422b0807aad8b290.zip gcc-aa0db437bce053c3e9fe55ad422b0807aad8b290.tar.gz gcc-aa0db437bce053c3e9fe55ad422b0807aad8b290.tar.bz2 |
PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’
gcc/testsuite/ChangeLog:
PR c/69507
* gcc.dg/alignof.c: New test.
gcc/c/ChangeLog:
PR c/69507
* c-parser.c (c_parser_alignof_expression): Avoid diagnosing
__alignof__ (expression).
From-SVN: r237581
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index ff32479..78bf68e 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -7091,9 +7091,10 @@ c_parser_alignof_expression (c_parser *parser) mark_exp_read (expr.value); c_inhibit_evaluation_warnings--; in_alignof--; - pedwarn (start_loc, - OPT_Wpedantic, "ISO C does not allow %<%E (expression)%>", - alignof_spelling); + if (is_c11_alignof) + pedwarn (start_loc, + OPT_Wpedantic, "ISO C does not allow %<%E (expression)%>", + alignof_spelling); ret.value = c_alignof_expr (start_loc, expr.value); ret.original_code = ERROR_MARK; ret.original_type = NULL; |