https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20040
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:6cd51207f5732b5258e883e9030b94c987b6d696 commit r12-6375-g6cd51207f5732b5258e883e9030b94c987b6d696 Author: Jason Merrill <ja...@redhat.com> Date: Thu Jan 6 16:13:04 2022 -0500 c++: check delete access with trivial init [PR20040] Apparently we need to check the accessibility of the deallocation function even if there is no initialization. PR c++/20040 gcc/cp/ChangeLog: * init.c (build_new_1): Also build pointer cleanup if TYPE_GETS_DELETE. * cp-tree.h (TYPE_GETS_VEC_DELETE): New. gcc/testsuite/ChangeLog: * g++.dg/init/delete4.C: New test.