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.
Loading
Please register or sign in to comment