https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110057
--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> --- So something like this, and then use it in containers instead of _Alloc_traits::destroy template<typename _Tp, typename _Allocator> _GLIBCXX20_CONSTEXPR void _Destroy_static_type(_Tp* __p, _Allocator& __alloc) { #if __cplusplus >= 201103L if constexpr (__allocator_traits_base::__has_destroy<_Allocator, _Tp>) allocator_traits<_Allocator>::destroy(__alloc, __p); else #endif __p->_Tp::~_Tp(); }