diff options
Diffstat (limited to 'libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp')
-rw-r--r-- | libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp index c06797a24588..cff4d75b2c9c 100644 --- a/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp @@ -17,7 +17,7 @@ #include "min_allocator.h" template <class S> -void +TEST_CONSTEXPR_CXX20 void test(const S& s, const typename S::value_type* str, typename S::size_type pos, typename S::size_type x) { @@ -31,7 +31,7 @@ test(const S& s, const typename S::value_type* str, typename S::size_type pos, } template <class S> -void +TEST_CONSTEXPR_CXX20 void test(const S& s, const typename S::value_type* str, typename S::size_type x) { LIBCPP_ASSERT_NOEXCEPT(s.find(str)); @@ -44,7 +44,7 @@ test(const S& s, const typename S::value_type* str, typename S::size_type x) } template <class S> -void test0() +TEST_CONSTEXPR_CXX20 void test0() { test(S(""), "", 0, 0); test(S(""), "abcde", 0, S::npos); @@ -129,7 +129,7 @@ void test0() } template <class S> -void test1() +TEST_CONSTEXPR_CXX20 void test1() { test(S(""), "", 0); test(S(""), "abcde", S::npos); @@ -149,19 +149,28 @@ void test1() test(S("abcdeabcdeabcdeabcde"), "abcdeabcdeabcdeabcde", 0); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test0<S>(); test1<S>(); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; test0<S>(); test1<S>(); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; |