https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126120
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <[email protected]>: https://gcc.gnu.org/g:e4f550457b0b5c9c87356f6dfc60ae980e319585 commit r17-4556-ge4f550457b0b5c9c87356f6dfc60ae980e319585 Author: Patrick Palka <[email protected]> Date: Thu Sep 17 09:26:02 2026 +0200 libstdc++: Fix SFINAE with shared_ptr and invalid deleter [PR126120] This implements the [util.smartptr.shared.const] constraints on the constructors that take a deleter (which before C++20 were requirements rather than constraints). In passing proactively implement the proposed resolution of LWG 4110 which relaxes these constraints on the nullptr_t overloads. PR libstdc++/126120 libstdc++-v3/ChangeLog: * include/bits/shared_ptr.h (std::__shared_nullptr_ctor_tag): Define. (shared_ptr::shared_ptr(nullptr_t, ...)): Constrain _Deleter via _NullptrDeleter parameter. * include/bits/shared_ptr_base.h (__shared_ptr::_ValidDeleter): New __enable_if_t constraint. (__shared_ptr::__shared_ptr(Yp*, _Deleter, ...)): Add _ValidDeleter constraint. Move static_assert checking deleter invocability to corresponding reset functions. (__shared_ptr::reset): Add static_assert checks for deleter invocability. * testsuite/20_util/shared_ptr/cons/126120.cc: New test. Co-authored-by: Tomasz KamiÅski <[email protected]> Reviewed-by: Jonathan Wakely <[email protected]>
