https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117463
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Simon Martin <simar...@gcc.gnu.org>: https://gcc.gnu.org/g:f32e7339871beec0e4d49698f7e34d77ee882088 commit r15-5110-gf32e7339871beec0e4d49698f7e34d77ee882088 Author: Simon Martin <si...@nasilyan.com> Date: Mon Nov 11 20:22:32 2024 +0100 c++: Fix another crash with invalid new operators [PR117463] Even though this PR is very close to PR117101, it's not addressed by the fix I made through r15-4958-g5821f5c8c89a05 because cxx_placement_new_fn has the very same issue as std_placement_new_fn_p used to have. As suggested by Jason, this patch changes both functions so that cxx_placement_new_fn leverages std_placement_new_fn_p which reduces code duplication and fixes the PR. PR c++/117463 gcc/cp/ChangeLog: * constexpr.cc (cxx_placement_new_fn): Implement in terms of std_placement_new_fn_p. * cp-tree.h (std_placement_new_fn_p): Declare. * init.cc (std_placement_new_fn_p): Add missing checks to ensure that fndecl is a non-replaceable ::operator new. gcc/testsuite/ChangeLog: * g++.dg/init/new54.C: New test.