]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use __cpp_lib_concepts in std::reverse_iterator [PR104098]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Jan 2022 15:34:24 +0000 (15:34 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 26 Apr 2022 13:11:01 +0000 (14:11 +0100)
We should not assume that std::iter_value_t etc. are defined
unconditionally for C++20 mode.

libstdc++-v3/ChangeLog:

PR libstdc++/104098
* include/bits/stl_iterator.h (reverse_iterator): Check
__cpp_lib_concepts instead of __cplusplus.

(cherry picked from commit e13e95bd274148a825bc9527efac49e99080dd64)

libstdc++-v3/include/bits/stl_iterator.h

index 85e58973ac66e1785b7319f14c0cec3f29ad6a4c..215822581a3d0f074e35190377d40dfd8aa890bb 100644 (file)
@@ -92,7 +92,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * @{
    */
 
-#if __cplusplus > 201703L && __cpp_lib_concepts
+#if __cpp_lib_concepts
   namespace __detail
   {
     // Weaken iterator_category _Cat to _Limit if it is derived from that,
@@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       typedef _Iterator                                        iterator_type;
       typedef typename __traits_type::pointer          pointer;
-#if __cplusplus <= 201703L
+#if ! __cpp_lib_concepts
       typedef typename __traits_type::difference_type  difference_type;
       typedef typename __traits_type::reference                reference;
 #else