public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Update __cpp_lib_adaptor_iterator_pair_constructor value
Date: Tue, 5 Oct 2021 09:37:45 +0100	[thread overview]
Message-ID: <YVwO2VcyWZ7hEBik@redhat.com> (raw)
In-Reply-To: <YVdk8WUt17EeIIgE@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

On 01/10/21 20:43 +0100, Jonathan Wakely wrote:
>This adds a feature that was recently added to the C++23 working draft.
>
>Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
>
>libstdc++-v3/ChangeLog:
>
>	* include/bits/stl_queue.h
>	(__cpp_lib_adaptor_iterator_pair_constructor): Define for C++23, as
>	per P1425R4.
>	(queue(InputIterator, InputIterator)): Likewise.
>	(queue(InputIterator, InputIterator, const Alloc&)): Likewise.
>	* include/bits/stl_stack.h
>	(__cpp_lib_adaptor_iterator_pair_constructor): Likewise.
>	(stack(InputIterator, InputIterator)): Likewise.
>	(stack(InputIterator, InputIterator, const Alloc&)): Likewise.
>	* include/std/version (__cpp_lib_adaptor_iterator_pair_constructor):
>	Define.
>	* testsuite/23_containers/queue/cons_from_iters.cc: New test.
>	* testsuite/23_containers/stack/cons_from_iters.cc: New test.

I forgot to update the patch to use the final value of the feature
test macro. It should be 202106L.

Tested powerpc64le-linux. Committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 3957 bytes --]

commit 9e136807c5b5476ed02a2a40a14fe0df3c0f4f18
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Oct 4 20:16:47 2021

    libstdc++: Update __cpp_lib_adaptor_iterator_pair_constructor value
    
    I started implementing this feature before it was voted into the C++ WP,
    and forgot to update the feature test macro after it was approved.
    
    This defines it to the correct value, as specified in the C++23 draft.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/stl_queue.h
            (__cpp_lib_adaptor_iterator_pair_constructor): Set to correct
            value.
            * include/bits/stl_stack.h
            (__cpp_lib_adaptor_iterator_pair_constructor): Likewise.
            * include/std/version
            (__cpp_lib_adaptor_iterator_pair_constructor): Likewise.
            * testsuite/23_containers/queue/cons_from_iters.cc: Update
            expected value.
            * testsuite/23_containers/stack/cons_from_iters.cc: Likewise.

diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 3da65c78eb8..68cfe865147 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -196,7 +196,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	: c(std::move(__q.c), __a) { }
 
 #if __cplusplus > 202002L
-#define __cpp_lib_adaptor_iterator_pair_constructor 202100L
+#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 
       template<typename _InputIterator,
 	       typename = _RequireInputIter<_InputIterator>>
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index f04fa6af479..429743f5514 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -171,7 +171,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       : c(std::move(__c)) { }
 
 #if __cplusplus > 202002L
-#define __cpp_lib_adaptor_iterator_pair_constructor 202100L
+#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 
       template<typename _InputIterator,
 	       typename = _RequireInputIter<_InputIterator>>
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index 66b3d1704b7..3d4a4142eec 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -281,7 +281,7 @@
 
 #if __cplusplus > 202002L
 // c++2b
-#define __cpp_lib_adaptor_iterator_pair_constructor 202100L
+#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 #define __cpp_lib_invoke_r 202106L
 #define __cpp_lib_is_scoped_enum 202011L
 #define __cpp_lib_string_contains 202011L
diff --git a/libstdc++-v3/testsuite/23_containers/queue/cons_from_iters.cc b/libstdc++-v3/testsuite/23_containers/queue/cons_from_iters.cc
index de0fc310c24..b826e745988 100644
--- a/libstdc++-v3/testsuite/23_containers/queue/cons_from_iters.cc
+++ b/libstdc++-v3/testsuite/23_containers/queue/cons_from_iters.cc
@@ -22,7 +22,7 @@
 
 #ifndef __cpp_lib_adaptor_iterator_pair_constructor
 #error Feature test macro for iterator pair constructors is missing in <queue>
-#elif __cpp_lib_adaptor_iterator_pair_constructor != 202100L
+#elif __cpp_lib_adaptor_iterator_pair_constructor != 202106L
 #error Feature test macro for iterator pair constructors has wrong value in <queue>
 #endif
 
diff --git a/libstdc++-v3/testsuite/23_containers/stack/cons_from_iters.cc b/libstdc++-v3/testsuite/23_containers/stack/cons_from_iters.cc
index 4c648926d62..ee06679d986 100644
--- a/libstdc++-v3/testsuite/23_containers/stack/cons_from_iters.cc
+++ b/libstdc++-v3/testsuite/23_containers/stack/cons_from_iters.cc
@@ -22,7 +22,7 @@
 
 #ifndef __cpp_lib_adaptor_iterator_pair_constructor
 #error Feature test macro for iterator pair constructors is missing in <stack>
-#elif __cpp_lib_adaptor_iterator_pair_constructor != 202100L
+#elif __cpp_lib_adaptor_iterator_pair_constructor != 202106L
 #error Feature test macro for iterator pair constructors has wrong value in <stack>
 #endif
 

      reply	other threads:[~2021-10-05  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 19:43 [committed] libstdc++: Add container adaptor constructors taking iterators (P1425R4) Jonathan Wakely
2021-10-05  8:37 ` Jonathan Wakely [this message]

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=YVwO2VcyWZ7hEBik@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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: link
Be 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).