From: Jonathan Wakely Date: Tue, 18 Jan 2022 15:34:24 +0000 (+0000) Subject: libstdc++: Use __cpp_lib_concepts in std::reverse_iterator [PR104098] X-Git-Tag: releases/gcc-11.3.0~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6bf63ff3684c28c3b2c4d3a67a42db738d6342d;p=thirdparty%2Fgcc.git libstdc++: Use __cpp_lib_concepts in std::reverse_iterator [PR104098] 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) --- diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 2b7efcbf3c3a..79e9959fc58e 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -93,7 +93,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, @@ -150,7 +150,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