From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD4453835831; Sun, 9 Jan 2022 09:10:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD4453835831 From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/103891] clang-13 fails to compile libstdc++'s std::variant>: error: attempt to use a deleted function Date: Sun, 09 Jan 2022 09:10:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: MOVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2022 09:10:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103891 --- Comment #5 from Sergei Trofimovich --- (In reply to Jonathan Wakely from comment #4) > I suppose we could just do: >=20 > --- 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 >=20=20 > -#if __cplusplus >=3D 202002L && __cpp_concepts > +#if __cplusplus >=3D 202002L && __cpp_concepts && __GNUC__ >=3D 12 > // P2231R1 constexpr needs constexpr unions and constrained destructors. > # define __cpp_lib_variant 202106L > #else >=20 > 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 ` as well.=