diff options
Diffstat (limited to 'libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp')
-rw-r--r-- | libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp index a6e8d1a69c0a..f65f9079a5df 100644 --- a/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.ops/string_find.last.of/string_size.pass.cpp @@ -17,7 +17,7 @@ #include "min_allocator.h" template <class S> -void +TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type pos, typename S::size_type x) { LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str, pos)); @@ -27,7 +27,7 @@ test(const S& s, const S& str, typename S::size_type pos, typename S::size_type } template <class S> -void +TEST_CONSTEXPR_CXX20 void test(const S& s, const S& str, typename S::size_type x) { LIBCPP_ASSERT_NOEXCEPT(s.find_last_of(str)); @@ -37,7 +37,7 @@ test(const S& s, const S& str, typename S::size_type x) } template <class S> -void test0() +TEST_CONSTEXPR_CXX20 void test0() { test(S(""), S(""), 0, S::npos); test(S(""), S("laenf"), 0, S::npos); @@ -122,7 +122,7 @@ void test0() } template <class S> -void test1() +TEST_CONSTEXPR_CXX20 void test1() { test(S(""), S(""), S::npos); test(S(""), S("laenf"), S::npos); @@ -142,26 +142,35 @@ void test1() test(S("pniotcfrhqsmgdkjbael"), S("htaobedqikfplcgjsmrn"), 19); } -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 #if TEST_STD_VER > 3 - { // LWG 2946 + { // LWG 2946 std::string s = " !"; assert(s.find_last_of({"abc", 1}) == std::string::npos); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; |