https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119964
--- Comment #5 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:e31e206b397d5c10d8d316a45a657e48b54f2047 commit r16-5549-ge31e206b397d5c10d8d316a45a657e48b54f2047 Author: Marek Polacek <[email protected]> Date: Fri Nov 21 15:34:35 2025 -0500 c++: refactor maybe_delete_defaulted_fn [PR119964] This does three things: 1) [dcl.fct.def.default]/2.6 says "if F1 is explicitly defaulted on its first declaration, it is defined as deleted;", but I wasn't heeding the "on its first declaration" part, so fix that; 2) when the decl is actually ill-formed, don't talk about it being implicitly deleted, because it's not; 3) there is no need to export maybe_delete_defaulted_fn. PR c++/119964 gcc/cp/ChangeLog: * cp-tree.h (maybe_delete_defaulted_fn): Remove. * method.cc (maybe_delete_defaulted_fn): Make static. Refactor. If FN is not explicitly defaulted on its first declaration, emit an error. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/defaulted1.C: New test. * g++.dg/cpp1y/defaulted2.C: New test. Reviewed-by: Jason Merrill <[email protected]>
