[Bug c++/69658] [6 Regression] Bogus "C99 designator outside aggregate initializer" error
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 4 13:50:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69658
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On this testcase, we used to call reshape_init already before, it is called
from
else
{
init = reshape_init (type, init, tf_warning_or_error);
flags |= LOOKUP_NO_NARROWING;
}
in check_initializer, and a few lines below this it calls
init_code = build_aggr_init_full_exprs (decl, init, flags);
that down the line calls expand_default_init and calls reshape_init again,
which is wrong from what I can understand, reshape_init should be called just
once.
On the other hand, on the mem-init-aggr1.C testcase, reshape_init has not been
called before, and thus it probably needs to be called.
More information about the Gcc-bugs
mailing list