Skip to content
Snippets Groups Projects
Commit bbc9c042 authored by Marek Polacek's avatar Marek Polacek
Browse files

c++: array new with value-initialization, again [PR115645]

Unfortunately, my r15-1946 fix broke the attached testcase; the
constexpr evaluation reported an error about not being able to
evaluate the code emitted by build_vec_init.  Jason figured out
it's because we were wrongly setting try_const to false, where
in fact it should have been true.  Value-initialization of scalars
is constexpr, so we should check that alongside of
type_has_constexpr_default_constructor.

	PR c++/115645

gcc/cp/ChangeLog:

	* init.cc (build_vec_init): When initializing a scalar type, try to
	create a constant initializer.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/constexpr-new23.C: New test.
parent f40fd85c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment