https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106320
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:2cad5c5c2de819b7a5177aa87e5e2fd088357b01 commit r10-10908-g2cad5c5c2de819b7a5177aa87e5e2fd088357b01 Author: Patrick Palka <ppa...@redhat.com> Date: Fri Jul 22 12:52:03 2022 -0400 libstdc++: Fix backward compatibility of P2325R3 backport [PR106320] The 11 and 10 partial backports of P2325R3, r11-9555-g92d612cccc1eec and r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the paper that made certain view specializations no longer default constructible, changes which aren't required to reap the overall benefits of the paper and which are backward incompatible with pre-P2325R3 code in practice. This patch reverts the problematic changes, specifically it relaxes the constraints on various views' default constructors added by the paper so that we keep only the constraints that were already implicitly imposed by the NSDMIs of the view. Thus for example this patch retains the default_initializable<_Vp> constraint on transform_view's default constructor since its '_Vp _M_base = _Vp()' NSDMI already requires this constraint, and it removes the default_initializable<_Fp> constraint since the corresponding member '__detail::__box<_Fp> _M_fun' doesn't require default constructibility (specializations of __box are always default constructible). After reverting these changes, all static_asserts from p2325.cc that verify lack of default constructibility now fail as expected, matching the pre-P2325R3 behavior. PR libstdc++/106320 libstdc++-v3/ChangeLog: * include/std/ranges (single_view): Relax constraints on default constructor so as to preserve pre-P2325R3 behavior. (filter_view): Likewise. (transform_view): Likewise. (take_while_view): Likewise. (drop_while_view): Likewise. * testsuite/std/ranges/adaptors/join.cc (test13): New test. * testsuite/std/ranges/p2325.cc: Fix S to be only non default constructible and not also non copy constructible. XFAIL the tests that verify a non default constructible functor makes a view non default constructible (lines 94, 97 and 98). XFAIL the test that effectively verifies a non default constructible element type makes single_view non default constructible (line 114). (cherry picked from commit 36dd51bf87e1c533bf33ad3b16fd3fe06c356746)