[libc++] Fix backdeployment annotations for std::filesystem

In 1fa27f2a10, we made <filesystem>'s iterator types model concepts
from <ranges>, but we forgot to add the appropriate availability
annotations. This broke back-deployment to platforms that don't have
<filesystem> for which we have availability annotations.

For some reason, this wasn't caught by our back-deployment CI.
I believe this is due to the fact that we use a slightly older
compiler in the CI, and perhaps that compiler does not honour
our `#pragma clang attribute push` properly.

Differential Revision: https://reviews.llvm.org/D114456
This commit is contained in:
Louis Dionne 2021-11-23 12:26:53 -05:00
parent aa60d169ea
commit 7a0584fe3f
7 changed files with 22 additions and 0 deletions

View File

@ -3024,13 +3024,17 @@ _LIBCPP_END_NAMESPACE_FILESYSTEM
#if !defined(_LIBCPP_HAS_NO_RANGES)
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::directory_iterator> = true;
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_borrowed_range<_VSTD_FS::recursive_directory_iterator> = true;
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
template <>
_LIBCPP_AVAILABILITY_FILESYSTEM
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
#endif

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class I>
// concept __iterator_traits_detail::__cpp17_bidirectional_iterator;

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class I>
// concept __iterator_traits_detail::__cpp17_forward_iterator;

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class I>
// concept __iterator_traits_detail::__cpp17_input_iterator;

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class I>
// concept __iterator_traits_detail::__cpp17_iterator;

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class I>
// concept __iterator_traits_detail::__cpp17_random_access_iterator;

View File

@ -9,6 +9,9 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// This test uses iterator types from std::filesystem, which were introduced in macOS 10.15.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14}}
// template<class T>
// struct iterator_traits;