From aa0db437bce053c3e9fe55ad422b0807aad8b290 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Sun, 19 Jun 2016 16:10:04 +0000 Subject: [PATCH] =?utf8?q?PR=20c/69507=20-=20bogus=20warning:=20ISO=20C=20?= =?utf8?q?does=20not=20allow=20=E2=80=98=5F=5Falignof=5F=5F=20(expression)?= =?utf8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-parser.c | 7 ++++--- gcc/testsuite/ChangeLog | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index e5d84bb308e..bd25ecaec6a 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-06-19 Martin Sebor + + PR c/69507 + * c-parser.c (c_parser_alignof_expression): Avoid diagnosing + __alignof__ (expression). + 2016-06-14 David Malcolm * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index ff32479685e..78bf68e677e 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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e717ea0851b..130d3e54b12 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-19 Martin Sebor + + PR c/69507 + * gcc.dg/alignof.c: New test. + 2016-06-17 Paolo Carlini * g++.dg/cpp0x/constexpr-specialization.C: Adjust for dg-message -- 2.30.2