summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__config6
-rw-r--r--libcxx/include/fstream16
-rw-r--r--libcxx/test/libcxx/input.output/filesystems/lit.local.cfg3
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp1
-rw-r--r--libcxx/test/std/input.output/filesystems/lit.local.cfg3
-rw-r--r--libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp1
-rw-r--r--libcxx/utils/libcxx/test/config.py4
13 files changed, 32 insertions, 8 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index c1770c1e5fe..9a58a2f92c2 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1354,6 +1354,11 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
__attribute__((availability(macosx,strict,introduced=10.9))) \
__attribute__((availability(ios,strict,introduced=7.0)))
+# define _LIBCPP_AVAILABILITY_FILESYSTEM \
+ __attribute__((availability(macosx,strict,unavailable))) \
+ __attribute__((availability(ios,strict,unavailable))) \
+ __attribute__((availability(tvos,strict,unavailable))) \
+ __attribute__((availability(watchos,strict,unavailable)))
#else
# define _LIBCPP_AVAILABILITY_SHARED_MUTEX
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
@@ -1365,6 +1370,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+# define _LIBCPP_AVAILABILITY_FILESYSTEM
#endif
// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 1902ce9afa6..60a05b0d4b9 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -235,7 +235,7 @@ public:
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
return open(__p.c_str(), __mode);
}
@@ -757,7 +757,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
this->eback() + __ibs_, __inext);
if (__r == codecvt_base::noconv)
{
- this->setg((char_type*)__extbuf_, (char_type*)__extbuf_,
+ this->setg((char_type*)__extbuf_, (char_type*)__extbuf_,
(char_type*)const_cast<char *>(__extbufend_));
__c = traits_type::to_int_type(*this->gptr());
}
@@ -1151,7 +1151,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
: basic_ifstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1177,7 +1177,7 @@ public:
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p,
ios_base::openmode __mode = ios_base::in) {
return open(__p.c_str(), __mode);
@@ -1365,7 +1365,7 @@ public:
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
: basic_ofstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1392,7 +1392,7 @@ public:
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
{ return open(__p.c_str(), __mode); }
#endif // _LIBCPP_STD_VER >= 17
@@ -1579,7 +1579,7 @@ public:
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
: basic_fstream(__p.c_str(), __mode) {}
#endif // _LIBCPP_STD_VER >= 17
@@ -1607,7 +1607,7 @@ public:
void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#if _LIBCPP_STD_VER >= 17
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY
void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
{ return open(__p.c_str(), __mode); }
#endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/test/libcxx/input.output/filesystems/lit.local.cfg b/libcxx/test/libcxx/input.output/filesystems/lit.local.cfg
new file mode 100644
index 00000000000..4a285ee2220
--- /dev/null
+++ b/libcxx/test/libcxx/input.output/filesystems/lit.local.cfg
@@ -0,0 +1,3 @@
+# Disable all of the filesystem tests if the dylib under test doesn't support them.
+if 'dylib-has-no-filesystem' in config.available_features:
+ config.unsupported = True
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
index ea244e1a32d..4f8bacb205d 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
index d86b4b6ccf8..19a64314ee8 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
index 799829e2bb2..f9de1c7d762 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
index 8a3a361bb39..2e92735c816 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
index bce5fb97dd1..ecac4896e34 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
index 254d696aaf7..b742f5f6ef7 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
index 1b783f6d5e8..2061fa5f33b 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: dylib-has-no-filesystem
// <fstream>
diff --git a/libcxx/test/std/input.output/filesystems/lit.local.cfg b/libcxx/test/std/input.output/filesystems/lit.local.cfg
new file mode 100644
index 00000000000..4a285ee2220
--- /dev/null
+++ b/libcxx/test/std/input.output/filesystems/lit.local.cfg
@@ -0,0 +1,3 @@
+# Disable all of the filesystem tests if the dylib under test doesn't support them.
+if 'dylib-has-no-filesystem' in config.available_features:
+ config.unsupported = True
diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
index ef616570b70..3fa3cb812f5 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// XFAIL: dylib-has-no-filesystem
// <chrono>
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 2fead3a2f82..c78e18982ee 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -1151,6 +1151,10 @@ class Configuration(object):
self.config.available_features.add('dylib-has-no-bad_any_cast')
self.lit_config.note("throwing bad_any_cast is not supported by the deployment target")
+ # Filesystem is not supported on Apple platforms yet
+ if name == 'macosx':
+ self.config.available_features.add('dylib-has-no-filesystem')
+ self.lit_config.note("the deployment target does not support the dylib parts of <filesystem>")
else:
self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
OpenPOWER on IntegriCloud