public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/103891] clang-13 fails to compile libstdc++'s std::variant<std::vector<int>>: error: attempt to use a deleted function
Date: Sun, 09 Jan 2022 09:10:42 +0000	[thread overview]
Message-ID: <bug-103891-4-N0T5SMthsw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103891-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2022-01-09  9:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 21:40 [Bug libstdc++/103891] New: " slyfox at gcc dot gnu.org
2022-01-02 21:59 ` [Bug libstdc++/103891] " pinskia at gcc dot gnu.org
2022-01-03 15:55 ` ppalka at gcc dot gnu.org
2022-01-04 10:07 ` redi at gcc dot gnu.org
2022-01-04 10:17 ` redi at gcc dot gnu.org
2022-01-09  9:10 ` slyfox at gcc dot gnu.org [this message]
2022-01-11 13:24 ` cvs-commit at gcc dot gnu.org
2022-01-11 13:32 ` redi at gcc dot gnu.org
2022-01-11 16:27 ` slyfox at gcc dot gnu.org
2022-02-14 13:06 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103891-4-N0T5SMthsw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).