https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80553

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We can't change the silly rule, but I suppose we could do:

--- a/libstdc++-v3/include/bits/stl_construct.h
+++ b/libstdc++-v3/include/bits/stl_construct.h
@@ -114,7 +114,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
       template<typename _ForwardIterator>
         static void
-        __destroy(_ForwardIterator, _ForwardIterator) { }
+        __destroy(_ForwardIterator, _ForwardIterator)
+       {
+#if __cplusplus >= 201103L
+         using _Tp
+           = typename std::iterator_traits<_ForwardIterator>::value_type;
+         static_assert( std::is_destructible<_Tp>::value,
+             "type must be destructible" );
+#endif
+       }
     };

   /**

So we get a diagnostic for trying to destroy something that isn't destructible.

Reply via email to