re PR c/66066 (r222889 causes bogus error: initializer element is not constant)
authorMarek Polacek <polacek@redhat.com>
Thu, 14 May 2015 11:42:53 +0000 (11:42 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 14 May 2015 11:42:53 +0000 (11:42 +0000)
commit3aa3c9fc9a5f82f23717386df7fa342e0a89b627
treef48930586f2a03d6d44f7e85c4dfe7f4f6c23873
parent12b3286d41a6aedba8e295a7c7934ec124904b55
re PR c/66066 (r222889 causes bogus error: initializer element is not constant)

PR c/66066
PR c/66127
* c-common.c (c_fully_fold): Pass false down to c_fully_fold_internal.
(c_fully_fold_internal): Fold C_MAYBE_CONST_EXPRs with
C_MAYBE_CONST_EXPR_INT_OPERANDS set.  Add FOR_INT_CONST argument and
use it.  If FOR_INT_CONST, require that all evaluated operands be
INTEGER_CSTs.

* c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
rather than with 0.

* gcc.dg/pr14649-1.c: Add -Wpedantic.
* gcc.dg/pr19984.c: Likewise.
* gcc.dg/pr66066-1.c: New test.
* gcc.dg/pr66066-2.c: New test.
* gcc.dg/pr66066-3.c: New test.

From-SVN: r223193
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr14649-1.c
gcc/testsuite/gcc.dg/pr19984.c
gcc/testsuite/gcc.dg/pr66066-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr66066-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr66066-3.c [new file with mode: 0644]