public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r14-5520] libstdc++: Adjust feature test in <istream> and <ostream>
Date: Thu, 16 Nov 2023 08:01:54 +0000 (GMT)	[thread overview]
Message-ID: <20231116080154.DC9313847819@sourceware.org> (raw)

https://gcc.gnu.org/g:17aca35c0ecd23de40c1352c0a7220bad3f11cfc

commit r14-5520-g17aca35c0ecd23de40c1352c0a7220bad3f11cfc
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Nov 14 15:48:03 2023 +0000

    libstdc++: Adjust feature test in <istream> and <ostream>
    
    We don't need any library concepts to define the constraints for rvalue
    stream overloads, only compiler support. So change the test from using
    __cpp_lib_concepts to __cpp_concepts >= 201907L.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/istream (__rvalue_stream_extraction_t): Test
            __cpp_concepts instead of __cpp_lib_concepts.
            * include/std/ostream (__derived_from_ios_base): Likewise.
            (__rvalue_stream_insertion_t): Likewise.

Diff:
---
 libstdc++-v3/include/std/istream | 2 +-
 libstdc++-v3/include/std/ostream | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 25d36973f4b..c2b30b75957 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -1069,7 +1069,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // 2328. Rvalue stream extraction should use perfect forwarding
   // 1203. More useful rvalue stream insertion
 
-#if __cpp_lib_concepts
+#if __cpp_concepts >= 201907L
   template<typename _Is, typename _Tp>
     requires __derived_from_ios_base<_Is>
       && requires (_Is& __is, _Tp&& __t) { __is >> std::forward<_Tp>(__t); }
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 5f973fa11ed..1de1c1bd359 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -763,7 +763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // 1203. More useful rvalue stream insertion
 
-#if __cpp_lib_concepts
+#if __cpp_concepts >= 201907L
   // Use concepts if possible because they're cheaper to evaluate.
   template<typename _Tp>
     concept __derived_from_ios_base = is_class_v<_Tp>

                 reply	other threads:[~2023-11-16  8:01 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=20231116080154.DC9313847819@sourceware.org \
    --to=redi@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: 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).