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

--- Comment #5 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> I suppose we could just do:
> 
> --- a/libstdc++-v3/include/std/variant
> +++ b/libstdc++-v3/include/std/variant
> @@ -54,7 +54,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
>  {
>  _GLIBCXX_BEGIN_NAMESPACE_VERSION
>  
> -#if __cplusplus >= 202002L && __cpp_concepts
> +#if __cplusplus >= 202002L && __cpp_concepts && __GNUC__ >= 12
>  // P2231R1 constexpr needs constexpr unions and constrained destructors.
>  # define __cpp_lib_variant 202106L
>  #else
> 
> And then improve it later if GCC updates __cpp_concepts

That almost works:

In file included from bug.cc:12:
stdc++-include/c++/12.0.0/variant:300:18: error: no template named
'__aligned_membuf' in namespace '__gnu_cxx'
      __gnu_cxx::__aligned_membuf<_Type> _M_storage;
      ~~~~~~~~~~~^

On clang it also needs `#include <ext/aligned_buffer.h>` as well.

Reply via email to