]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Adjust feature test in <istream> and <ostream>
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 Nov 2023 15:48:03 +0000 (15:48 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 16 Nov 2023 08:00:36 +0000 (08:00 +0000)
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
libstdc++-v3/include/std/ostream

index 25d36973f4b01bd590953bc8cc1c0772e7ea79f0..c2b30b75957ba6bd906c8809d04fa8d8c12e2eae 100644 (file)
@@ -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); }
index 5f973fa11ed6b2915ebd37e824afea60e44b153a..1de1c1bd359d20361197a23d373de3dc94a9be2a 100644 (file)
@@ -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>