public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6561] libstdc++: Implement LWG 3796 changes to repeat_/chunk_by_view [PR109024]
@ 2023-03-09 18:37 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2023-03-09 18:37 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

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();
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-09 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 18:37 [gcc r13-6561] libstdc++: Implement LWG 3796 changes to repeat_/chunk_by_view [PR109024] Patrick Palka

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).