public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-6561] libstdc++: Implement LWG 3796 changes to repeat_/chunk_by_view [PR109024] Date: Thu, 9 Mar 2023 18:37:44 +0000 (GMT) [thread overview] Message-ID: <20230309183744.362773858D20@sourceware.org> (raw) https://gcc.gnu.org/g:065c93b89c5e97dcbfd79ee5172cf6800c286896 commit r13-6561-g065c93b89c5e97dcbfd79ee5172cf6800c286896 Author: Patrick Palka <ppalka@redhat.com> Date: Thu Mar 9 13:37:29 2023 -0500 libstdc++: Implement LWG 3796 changes to repeat_/chunk_by_view [PR109024] PR libstdc++/109024 libstdc++-v3/ChangeLog: * include/std/ranges (chunk_by_view::_M_pred): Remove DMI as per LWG 3796. (repeat_view::_M_pred): Likewise. * testsuite/std/ranges/adaptors/chunk_by/1.cc (test03): New test. * testsuite/std/ranges/repeat/1.cc (test05): New test. Diff: --- libstdc++-v3/include/std/ranges | 4 ++-- libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc | 8 ++++++++ libstdc++-v3/testsuite/std/ranges/repeat/1.cc | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 867844e9e12..f6809413ee1 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -6735,7 +6735,7 @@ namespace views::__adaptor class chunk_by_view : public view_interface<chunk_by_view<_Vp, _Pred>> { _Vp _M_base = _Vp(); - __detail::__box<_Pred> _M_pred = _Pred(); + __detail::__box<_Pred> _M_pred; __detail::_CachedPosition<_Vp> _M_cached_begin; constexpr iterator_t<_Vp> @@ -7411,7 +7411,7 @@ namespace views::__adaptor && (__detail::__is_integer_like<_Bound> || same_as<_Bound, unreachable_sentinel_t>)) class repeat_view : public view_interface<repeat_view<_Tp, _Bound>> { - __detail::__box<_Tp> _M_value = _Tp(); + __detail::__box<_Tp> _M_value; [[no_unique_address]] _Bound _M_bound = _Bound(); struct _Iterator; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc index cba6fad6f9a..f165c7d9a95 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc @@ -54,9 +54,17 @@ test02() VERIFY( i == v.end() ); } +void +test03() +{ + // LWG 3796 + ranges::chunk_by_view<ranges::empty_view<int>, ranges::equal_to> r; +} + int main() { static_assert(test01()); test02(); + test03(); } diff --git a/libstdc++-v3/testsuite/std/ranges/repeat/1.cc b/libstdc++-v3/testsuite/std/ranges/repeat/1.cc index 2f3ad4522a4..07b70891042 100644 --- a/libstdc++-v3/testsuite/std/ranges/repeat/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/repeat/1.cc @@ -120,6 +120,13 @@ test04() return true; } +void +test05() +{ + // LWG 3796 + ranges::repeat_view<int> r; +} + int main() { @@ -127,4 +134,5 @@ main() static_assert(test02()); static_assert(test03()); static_assert(test04()); + test05(); }
reply other threads:[~2023-03-09 18:37 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230309183744.362773858D20@sourceware.org \ --to=ppalka@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@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: linkBe 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).