//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03 // // template struct __is_pathable // [path.req] // In addition to the requirements (5), function template parameters named // `Source` shall be one of: // * basic_string<_ECharT, _Traits, _Alloc> // * InputIterator with a value_type of _ECharT // * A character array, which points to a NTCTS after array-to-pointer decay. #include #include #include #include "test_macros.h" #include "test_iterators.h" #include "min_allocator.h" #include "constexpr_char_traits.hpp" namespace fs = std::experimental::filesystem; using fs::__is_pathable; template struct Identity { typedef Tp type; }; template Identity CheckSourceType(Source const&); template using GetSourceType = typename decltype(CheckSourceType(std::declval()))::type; template ::type> using CheckPass = std::is_same>; template using CheckPassSource = std::integral_constant::value && CheckPass::value && CheckPass::value && CheckPass::value >; template struct MakeTestType { using value_type = CharT; using string_type = std::basic_string; using string_type2 = std::basic_string, min_allocator>; using string_view_type = std::basic_string_view; using string_view_type2 = std::basic_string_view>; using cstr_type = CharT* const; using const_cstr_type = const CharT*; using array_type = CharT[25]; using const_array_type = const CharT[25]; using iter_type = input_iterator; using bad_iter_type = input_iterator; template static void AssertPathable() { static_assert(__is_pathable::value, ""); static_assert(CheckPassSource::value, "cannot pass as Source const&"); ASSERT_SAME_TYPE(CharT, typename __is_pathable::__char_type); } template static void AssertNotPathable() { static_assert(!__is_pathable::value, ""); } static void Test() { AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertPathable(); AssertNotPathable(); AssertNotPathable(); AssertNotPathable(); } }; int main() { MakeTestType::Test(); MakeTestType::Test(); MakeTestType::Test(); MakeTestType::Test(); }