https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69507
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2016-01-27
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot
gnu.org
Ever confirmed|0 |1
Known to fail| |4.9.3, 5.1.0, 6.0
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
This seems like a simple matter of a missed conditional in the parser. The
following change suppresses the warning. Let me add a test and post it for
review.
Index: gcc/c/c-parser.c
===================================================================
--- gcc/c/c-parser.c (revision 232841)
+++ gcc/c/c-parser.c (working copy)
@@ -7019,9 +7019,10 @@ c_parser_alignof_expression (c_parser *p
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;