From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B94A63852744; Mon, 18 Jul 2022 13:25:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B94A63852744 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106320] [10 regression] build failure (due to view requirement changes?) Date: Mon, 18 Jul 2022 13:25:34 +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: 10.4.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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: Mon, 18 Jul 2022 13:25:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106320 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot g= nu.org --- Comment #5 from Patrick Palka --- P2328 constrains the default ctors of various views and iterators. Some of these constraints just repeat what is already implicitly required by the NSDMIs, such as default_initializable<_Vp> in transform_view. Note that GCC already treats NSDMIs as part of the "immediate context" when synthesizing a default constructor, such that if an NSDMI is ill-formed then the construct= or will get defined as deleted. So these constraints are redundant for GCC at least, but IIUC this behavior is an extension that other compilers e.g. Cla= ng don't implement: https://godbolt.org/z/s4a7axYv7. Backporting these constraints should be safe since for GCC they have no effect and for other compilers they'd just make some invalid programs valid. But P2328 also adds default ctor constraints that weren't already implicitly required by the NSDMIs, such as default_initializable<_Fp> in transform_vie= w.=20 (The corresponding data member _M_fun is always default constructible since= it uses the semiregular wrapper __box.) We shouldn't have backported _these_ constraints since they cause some views to no longer be default xible. I think we can salvage the backport by removing the problematic constraints added by r10-10808-g22b86cdc4d7fdd: libstdc++-v3/include/std/ranges | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ran= ges index 17018a5616c..faa55ebceb7 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -518,7 +518,7 @@ namespace ranges class single_view : public view_interface> { public: - single_view() requires default_initializable<_Tp> =3D default; + single_view() =3D default; constexpr explicit single_view(const _Tp& __t) @@ -1592,9 +1592,7 @@ namespace views [[no_unique_address]] __detail::_CachedPosition<_Vp> _M_cached_begin; public: - filter_view() requires (default_initializable<_Vp> - && default_initializable<_Pred>) - =3D default; + filter_view() requires default_initializable<_Vp> =3D default; constexpr filter_view(_Vp __base, _Pred __pred) @@ -1940,9 +1938,7 @@ namespace views __detail::__box<_Fp> _M_fun; public: - transform_view() requires (default_initializable<_Vp> - && default_initializable<_Fp>) - =3D default; + transform_view() requires default_initializable<_Vp> =3D default; constexpr transform_view(_Vp __base, _Fp __fun) @@ -2220,9 +2216,7 @@ namespace views __detail::__box<_Pred> _M_pred; public: - take_while_view() requires (default_initializable<_Vp> - && default_initializable<_Pred>) - =3D default; + take_while_view() requires default_initializable<_Vp> =3D default; constexpr take_while_view(_Vp base, _Pred __pred) @@ -2389,9 +2383,7 @@ namespace views [[no_unique_address]] __detail::_CachedPosition<_Vp> _M_cached_begin; public: - drop_while_view() requires (default_initializable<_Vp> - && default_initializable<_Pred>) - =3D default; + drop_while_view() requires default_initializable<_Vp> =3D default; constexpr drop_while_view(_Vp __base, _Pred __pred)=