PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’
authorMartin Sebor <msebor@redhat.com>
Sun, 19 Jun 2016 16:10:04 +0000 (16:10 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Sun, 19 Jun 2016 16:10:04 +0000 (10:10 -0600)
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
gcc/c/c-parser.c
gcc/testsuite/ChangeLog

index e5d84bb308ea26840e24e687828c3ff24bea24a4..bd25ecaec6ac323bdd74d8fdd2b0bf5ea18c2fb0 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-19 Martin Sebor  <msebor@redhat.com>
+
+       PR c/69507
+       * c-parser.c (c_parser_alignof_expression): Avoid diagnosing
+       __alignof__ (expression).
+
 2016-06-14  David Malcolm  <dmalcolm@redhat.com>
 
        * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
index ff32479685e517c9ab5c31324b8d4f3bb12bad97..78bf68e677eea4093ef9d903d221b5bb6d55a287 100644 (file)
@@ -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;
index e717ea0851befaa08cda110dfea18762c0d273bb..130d3e54b1265e5871839e4410ef7e73824562ea 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-19 Martin Sebor  <msebor@redhat.com>
+
+       PR c/69507
+       * gcc.dg/alignof.c: New test.
+
 2016-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/cpp0x/constexpr-specialization.C: Adjust for dg-message