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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There seem to be two separate bugs here, which I don't understand.

The clang error is fixed by:

--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -661,6 +661,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
         {
          if (__n > 0)
            {
+#ifdef __cpp_lib_is_constant_evaluated
+             if (std::is_constant_evaluated())
+               return __uninitialized_default_n_1<false>::
+                        __uninit_default_n(__first, __n);
+#endif
              typename iterator_traits<_ForwardIterator>::value_type* __val
                = std::__addressof(*__first);
              std::_Construct(__val);

But this doesn't fix the error with GCC.

Reply via email to