re PR c/456 (constant expressions constraints (gcc.dg/c90-const-expr-1))
PR c/456
* cppexp.c (num_binary_op): Don't allow comma operators in #if
constant expressions at all outside C99 mode if pedantic.
testsuite:
* gcc.dg/cpp/c90-if-comma-1.c, gcc.dg/cpp/c99-if-comma-1.c:
New tests.
From-SVN: r77676
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index c6f1f1d..5603f5b 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -1347,7 +1347,8 @@
/* Comma. */
default: /* case CPP_COMMA: */
- if (CPP_PEDANTIC (pfile) && !pfile->state.skip_eval)
+ if (CPP_PEDANTIC (pfile) && (!CPP_OPTION (pfile, c99)
+ || !pfile->state.skip_eval))
cpp_error (pfile, CPP_DL_PEDWARN,
"comma operator in operand of #if");
lhs = rhs;