re PR c/83222 (Inconsistent "initializer element is not constant" error)
authorJakub Jelinek <jakub@redhat.com>
Thu, 30 Nov 2017 23:43:10 +0000 (00:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 30 Nov 2017 23:43:10 +0000 (00:43 +0100)
commitcc6534d40136b8afb5dcd878e58d106f31b51dd2
tree45bebb503a52bf8726cdc05432ea9875c8ef1bdd
parent5de73c050e4dbb3dfc8705bf20199aedb090df20
re PR c/83222 (Inconsistent "initializer element is not constant" error)

PR c/83222
* c-tree.h (decl_constant_value_1): Declare.
* c-typeck.c (decl_constant_value_1): New function.
(decl_constant_value): Use it.
* c-fold.c (c_fully_fold_internal): If in_init, use
decl_constant_value_1 instead of decl_constant_value.

* gcc.c-torture/compile/pr83222.c: New test.

From-SVN: r255285
gcc/c/ChangeLog
gcc/c/c-fold.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr83222.c [new file with mode: 0644]