From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 594FB3858CDB; Wed, 29 Mar 2023 08:38:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 594FB3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680079099; bh=ggco7cb8aIe20uUHLmdGETLK6UHmvnzqEPcRxIkXwGM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RJVpD1fHU3mB5D7wOYYhX5hyOgKhboNGT7rMJn3NlxfqyDuky0Q6sqqXNk57egJ6N cLJTuje4Y1Bjy8vepnpkiDhwP9XpWKHUEE4A4BXeMx9iH7djJwfl62fX9bX5Cw9KNR WDgMRn+wiE47ECAmbFQMk1878L8hFJeRcusTxrZc= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106608] std::optional requires unavailable dtor when compiled with clang Date: Wed, 29 Mar 2023 08:38:16 +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.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: 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: short_desc keywords target_milestone 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106608 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[12/13 Regression] |std::optional requires |std::optional requires |unavailable dtor when |unavailable dtor |compiled with clang Keywords|needs-bisection, | |rejects-valid | Target Milestone|12.3 |--- --- Comment #8 from Jonathan Wakely --- Also, there's no regression. I don't know why you think this has anything t= o do with GCC 12. Given this code: #include #include using namespace std; struct ScanInfo; struct List { List(optional>&& =3D nullopt); }; All versions of GCC compile it. Clang rejects it with all libstdc++ headers: $ clang++ -std=3Dc++17 -c inc.cc --gcc-toolchain=3D$HOME/gcc/8 In file included from inc.cc:2: In file included from /home/jwakely/gcc/8/lib/gcc/x86_64-pc-linux-gnu/8.5.0/../../../../include/c= ++/8.5.0/vector:62: /home/jwakely/gcc/8/lib/gcc/x86_64-pc-linux-gnu/8.5.0/../../../../include/c= ++/8.5.0/bits/stl_construct.h:133:7: error: static assertion failed due to requirement 'is_destructible::value': value type is destructible $ clang++ -std=3Dc++17 -c inc.cc --gcc-toolchain=3D$HOME/gcc/9 In file included from inc.cc:2: In file included from /home/jwakely/gcc/9/lib/gcc/x86_64-pc-linux-gnu/9.5.0/../../../../include/c= ++/9.5.0/vector:65: /home/jwakely/gcc/9/lib/gcc/x86_64-pc-linux-gnu/9.5.0/../../../../include/c= ++/9.5.0/bits/stl_construct.h:133:7: error: static assertion failed due to requirement 'is_destructible::value': value type is destructible $ clang++ -std=3Dc++17 -c inc.cc --gcc-toolchain=3D$HOME/gcc/10 In file included from inc.cc:1: In file included from /home/jwakely/gcc/10/lib/gcc/x86_64-pc-linux-gnu/10.4.1/../../../../include= /c++/10.4.1/optional:36: In file included from /home/jwakely/gcc/10/lib/gcc/x86_64-pc-linux-gnu/10.4.1/../../../../include= /c++/10.4.1/utility:70: In file included from /home/jwakely/gcc/10/lib/gcc/x86_64-pc-linux-gnu/10.4.1/../../../../include= /c++/10.4.1/bits/stl_pair.h:59: In file included from /home/jwakely/gcc/10/lib/gcc/x86_64-pc-linux-gnu/10.4.1/../../../../include= /c++/10.4.1/bits/move.h:57: /home/jwakely/gcc/10/lib/gcc/x86_64-pc-linux-gnu/10.4.1/../../../../include= /c++/10.4.1/type_traits:844:7: error: static assertion failed due to requirement 'std::__is_complete_or_unbounded(std::__type_identity{})': templa= te argument must be a complete class or an unbounded array $ clang++ -std=3Dc++17 -c inc.cc --gcc-toolchain=3D$HOME/gcc/11 In file included from inc.cc:1: In file included from /home/jwakely/gcc/11/lib/gcc/x86_64-pc-linux-gnu/11.3.1/../../../../include= /c++/11.3.1/optional:36: In file included from /home/jwakely/gcc/11/lib/gcc/x86_64-pc-linux-gnu/11.3.1/../../../../include= /c++/11.3.1/utility:70: In file included from /home/jwakely/gcc/11/lib/gcc/x86_64-pc-linux-gnu/11.3.1/../../../../include= /c++/11.3.1/bits/stl_pair.h:59: In file included from /home/jwakely/gcc/11/lib/gcc/x86_64-pc-linux-gnu/11.3.1/../../../../include= /c++/11.3.1/bits/move.h:57: /home/jwakely/gcc/11/lib/gcc/x86_64-pc-linux-gnu/11.3.1/../../../../include= /c++/11.3.1/type_traits:885:7: error: static assertion failed due to requirement 'std::__is_complete_or_unbounded(std::__type_identity{})': templa= te argument must be a complete class or an unbounded array $ clang++ -std=3Dc++17 -c inc.cc --gcc-toolchain=3D$HOME/gcc/12 In file included from inc.cc:1: In file included from /home/jwakely/gcc/12/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include= /c++/12.2.1/optional:37: /home/jwakely/gcc/12/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../include= /c++/12.2.1/type_traits:910:7: error: static assertion failed due to requirement 'std::__is_complete_or_unbounded(std::__type_identity{})': templa= te argument must be a complete class or an unbounded array=