https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115645
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <[email protected]>: https://gcc.gnu.org/g:bbc9c0423ca754e8e6ff80e08948ff52986337a0 commit r15-2435-gbbc9c0423ca754e8e6ff80e08948ff52986337a0 Author: Marek Polacek <[email protected]> Date: Wed Jul 17 15:44:26 2024 -0400 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.
