Fix various latent issues revealed by P0732 work.
commit59183fff1829ab6b4db926e381a73cd3da26225f
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Nov 2018 07:46:57 +0000 (5 07:46 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Nov 2018 07:46:57 +0000 (5 07:46 +0000)
tree93c5972f6c8b0ac891b9a3d2e0afdc8eda67bf8e
parent7b846a1df2df96da2ccd1a6b232dd294b3f2bd4d
Fix various latent issues revealed by P0732 work.

The initialized_type hunk fixes handling of void AGGR_INIT_EXPRs that call a
non-constructor; an AGGR_INIT_EXPR can have void type if its initialization
semantics are more complicated than just expanding the call.

The cxx_eval_vec_init_1 hunk corrects AGGR_INIT_EXPRs that were
nonsensically built to initialize an object of void type.  And the
build_aggr_init_expr hunk makes sure we don't do that again.

The ocp_convert and cxx_eval_outermost_constant_expr hunks deal with making
sure that a constant CONSTRUCTOR has the right type.

* cvt.c (ocp_convert): Don't wrap a CONSTRUCTOR in a NOP_EXPR.
* constexpr.c (initialized_type): Fix AGGR_INIT_EXPR handling.
(cxx_eval_vec_init_1): Correct type of AGGR_INIT_EXPR.
(cxx_eval_outermost_constant_expr): Make sure a CONSTRUCTOR has the
right type.  Don't wrap a CONSTRUCTOR if one was passed in.
* tree.c (build_aggr_init_expr): Check for void.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265788 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cvt.c
gcc/cp/tree.c