https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83801
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Sat Jan 13 17:00:43 2018 New Revision: 256608 URL: https://gcc.gnu.org/viewcvs?rev=256608&root=gcc&view=rev Log: PR c/83801 * c-tree.h (decl_constant_value_1): Add a bool argument. * c-typeck.c (decl_constant_value_1): Add IN_INIT argument, allow returning a CONSTRUCTOR if it is true. Use error_operand_p. (decl_constant_value): Adjust caller. * c-fold.c (c_fully_fold_internal): If in_init, pass true to decl_constant_value_1 as IN_INIT. Otherwise, punt if decl_constant_value returns initializer that has BLKmode or array type. (c_fully_fold_internal) <case COMPONENT_REF>: Fold if !lval. * gcc.dg/pr83801.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr83801.c Modified: trunk/gcc/c/ChangeLog trunk/gcc/c/c-fold.c trunk/gcc/c/c-tree.h trunk/gcc/c/c-typeck.c trunk/gcc/testsuite/ChangeLog