Fix compilation errors with Clang
authorJonathan Wakely <jwakely@redhat.com>
Tue, 29 Oct 2019 20:17:02 +0000 (20:17 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 29 Oct 2019 20:17:02 +0000 (20:17 +0000)
* include/bits/range_access.h (ranges::disable_sized_range)
(ranges::begin, ranges::end, ranges::cbegin, ranges::cend)
(ranges::rbegin, ranges::rend, ranges::crbegin, ranges::crend)
(ranges::size, ranges::empty, ranges::data, ranges::cdata)
(ranges::range, ranges::sized_range, ranges::advance, ranges::distance)
(ranges::next, ranges::prev): Guard with __cpp_lib_concepts.
* include/bits/stl_iterator.h (disable_sized_sentinel): Likewise.

From-SVN: r277589

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

index e9908841420b90f5cb8c61a1e2ea073ec52ea270..11cce3517bc89493bc4e056c7e85df5f42b51da1 100644 (file)
@@ -1,5 +1,13 @@
 2019-10-29  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/bits/range_access.h (ranges::disable_sized_range)
+       (ranges::begin, ranges::end, ranges::cbegin, ranges::cend)
+       (ranges::rbegin, ranges::rend, ranges::crbegin, ranges::crend)
+       (ranges::size, ranges::empty, ranges::data, ranges::cdata)
+       (ranges::range, ranges::sized_range, ranges::advance, ranges::distance)
+       (ranges::next, ranges::prev): Guard with __cpp_lib_concepts.
+       * include/bits/stl_iterator.h (disable_sized_sentinel): Likewise.
+
        * include/bits/alloc_traits.h (__cpp_lib_constexpr_dynamic_alloc):
        Define.
        (allocator_traits::_S_construct, allocator_traits::_S_destroy)
index 3b6ed9aa66a32eef7562a0146209228e8d6adb5b..9c8bef6b3a198a546332533c02646e3a543edd97 100644 (file)
@@ -349,6 +349,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __adl_data(_Container& __cont) noexcept(noexcept(data(__cont)))
     { return data(__cont); }
 
+#ifdef __cpp_lib_concepts
 namespace ranges
 {
   template<typename>
@@ -1061,6 +1062,7 @@ namespace ranges
     }
 
 } // namespace ranges
+#endif // library concepts
 #endif // C++20
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
index 966087598f4a5c72763ce2d5712932737e8f8925..c10117e9b3810d0d24877d83280e8fec2bd6e580 100644 (file)
@@ -442,7 +442,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     make_reverse_iterator(_Iterator __i)
     { return reverse_iterator<_Iterator>(__i); }
 
-#  if __cplusplus > 201703L
+#  if __cplusplus > 201703L && defined __cpp_lib_concepts
   template<typename _Iterator1, typename _Iterator2>
     requires (!sized_sentinel_for<_Iterator1, _Iterator2>)
     inline constexpr bool disable_sized_sentinel<reverse_iterator<_Iterator1>,