diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-08-28 21:26:01 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-08-28 21:26:01 +0000 |
commit | 2fc65041beabcb4c970deeb8ece010c10b0b40f9 (patch) | |
tree | 8cce662354b591f6e8dac297a744ae0721a2d7f7 /libcxx/test/std/experimental/filesystem/class.path/path.member/path.construct/source.pass.cpp | |
parent | 24b481370ac773231c38f15355a6277943a69911 (diff) | |
download | bcm5719-llvm-2fc65041beabcb4c970deeb8ece010c10b0b40f9.tar.gz bcm5719-llvm-2fc65041beabcb4c970deeb8ece010c10b0b40f9.zip |
Implement LWG 2711. Constrain path members.
llvm-svn: 279945
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.cpp | 32 |
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(); } |