[committed,1/2] libstdc++: Adjust feature test in <istream> and <ostream>

Message ID 20231116080314.1218556-1-jwakely@redhat.com
State Accepted
Headers
Series [committed,1/2] libstdc++: Adjust feature test in <istream> and <ostream> |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Jonathan Wakely Nov. 16, 2023, 8:02 a.m. UTC
  Tested x86_64-linux. Pushed to trunk.

-- >8 --

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.
---
 libstdc++-v3/include/std/istream | 2 +-
 libstdc++-v3/include/std/ostream | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

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>