summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp')
-rw-r--r--libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
index 402225de11b..a04f35af578 100644
--- a/libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
+++ b/libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp
@@ -80,6 +80,37 @@ void RunTestCase(MultiStringType const& MS) {
}
}
+void test_sfinae() {
+ using namespace fs;
+ {
+ using It = const char* const;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ using It = input_iterator<const char*>;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ struct Traits {
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const char;
+ using pointer = const char*;
+ using reference = const char&;
+ using difference_type = std::ptrdiff_t;
+ };
+ using It = input_iterator<const char*, Traits>;
+ static_assert(std::is_constructible<path, It>::value, "");
+ }
+ {
+ using It = output_iterator<const char*>;
+ static_assert(!std::is_constructible<path, It>::value, "");
+
+ }
+ {
+ static_assert(!std::is_constructible<path, int*>::value, "");
+ }
+}
+
int main() {
for (auto const& MS : PathList) {
RunTestCase<char>(MS);
@@ -87,4 +118,5 @@ int main() {
RunTestCase<char16_t>(MS);
RunTestCase<char32_t>(MS);
}
+ test_sfinae();
}
OpenPOWER on IntegriCloud