diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp index 82c7268cf663..c5188cf65b2e 100644 --- a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp @@ -35,7 +35,10 @@ void test() int main(int, char**) { - test(); + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif - return 0; + return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp index ccd3925b63fe..152e0702c00f 100644 --- a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp @@ -65,7 +65,10 @@ void test() int main(int, char**) { - test(); + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif - return 0; + return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp index bb40adef8fdb..648c67359d42 100644 --- a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp @@ -86,7 +86,10 @@ void test() int main(int, char**) { - test(); + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif - return 0; + return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.char.pass.cpp b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.char.pass.cpp index 2ef9f63685e6..1b418e313c2c 100644 --- a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.char.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.char.pass.cpp @@ -16,9 +16,8 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; S s1 {}; S s2 { "abcde", 5 }; @@ -29,7 +28,17 @@ int main(int, char**) assert (!s1.ends_with('x')); assert ( s2.ends_with('e')); assert (!s2.ends_with('x')); - } + } + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.ptr.pass.cpp b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.ptr.pass.cpp index 7d544783b211..c2654929b5d5 100644 --- a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.ptr.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.ptr.pass.cpp @@ -16,9 +16,8 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; const char *s = "abcde"; @@ -58,7 +57,16 @@ int main(int, char**) assert (!sNot.ends_with("bcde")); assert (!sNot.ends_with("abcde")); assert ( sNot.ends_with("def")); - } + } + + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.string_view.pass.cpp index e5ea23f88ca7..9f764499ab37 100644 --- a/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.string_view.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.ends_with/ends_with.string_view.pass.cpp @@ -16,9 +16,8 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; typedef std::string_view SV; const char *s = "abcde"; @@ -67,7 +66,16 @@ int main(int, char**) assert (!sNot.ends_with(sv4)); assert (!sNot.ends_with(sv5)); assert ( sNot.ends_with(svNot)); - } + } + + return true; +} + +int main(int, char**) { + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.iterators/begin.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/begin.pass.cpp index 8fa5e67f7e83..c6394fcb268e 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/begin.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/begin.pass.cpp @@ -18,7 +18,7 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(S s) { const S& cs = s; @@ -31,19 +31,28 @@ test(S s) assert(b == cb); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/cbegin.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/cbegin.pass.cpp index 78216dcdbd03..af9dfaa654c4 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/cbegin.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/cbegin.pass.cpp @@ -17,7 +17,7 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(const S& s) { typename S::const_iterator cb = s.cbegin(); @@ -28,19 +28,28 @@ test(const S& s) assert(cb == s.begin()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/cend.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/cend.pass.cpp index 0af2c0aeffed..b59546f3b4ab 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/cend.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/cend.pass.cpp @@ -24,20 +24,28 @@ test(const S& s) assert(ce == s.end()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } #endif + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.iterators/crbegin.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/crbegin.pass.cpp index 4476f88a055d..b5a2ec7a0d28 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/crbegin.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/crbegin.pass.cpp @@ -17,7 +17,7 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(const S& s) { typename S::const_reverse_iterator cb = s.crbegin(); @@ -28,19 +28,28 @@ test(const S& s) assert(cb == s.rbegin()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/crend.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/crend.pass.cpp index 6cd57aa53a41..090c22eabbc7 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/crend.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/crend.pass.cpp @@ -17,26 +17,35 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(const S& s) { typename S::const_reverse_iterator ce = s.crend(); assert(ce == s.rend()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/end.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/end.pass.cpp index 079bfdfef439..21d6b1bc2b45 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/end.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/end.pass.cpp @@ -19,7 +19,7 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(S s) { const S& cs = s; @@ -34,19 +34,28 @@ test(S s) assert(static_cast(ce - cs.begin()) == cs.size()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/rbegin.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/rbegin.pass.cpp index e20b10df4f84..13ec36b0a62a 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/rbegin.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/rbegin.pass.cpp @@ -18,7 +18,7 @@ #include "min_allocator.h" template -void +TEST_CONSTEXPR_CXX20 void test(S s) { const S& cs = s; @@ -31,19 +31,28 @@ test(S s) assert(b == cb); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.iterators/rend.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/rend.pass.cpp index fdeb9098e2f3..f2f1cde6f896 100644 --- a/libcxx/test/std/strings/basic.string/string.iterators/rend.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.iterators/rend.pass.cpp @@ -34,19 +34,28 @@ test(S s) assert(static_cast(ce - cs.rbegin()) == cs.size()); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test(S()); test(S("123")); - } + } #if TEST_STD_VER >= 11 - { + { typedef std::basic_string, min_allocator> S; test(S()); test(S("123")); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp b/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp index af34fc97ff5b..250d23bfb1fc 100644 --- a/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.require/contiguous.pass.cpp @@ -25,30 +25,39 @@ void test_contiguous ( const C &c ) assert ( *(c.begin() + static_cast(i)) == *(std::addressof(*c.begin()) + i)); } -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; test_contiguous(S()); test_contiguous(S("1")); test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890")); - } + } - { + { typedef test_allocator A; typedef std::basic_string, A> S; test_contiguous(S(A(3))); test_contiguous(S("1", A(5))); test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7))); - } + } #if TEST_STD_VER >= 11 - { + { typedef min_allocator A; typedef std::basic_string, A> S; test_contiguous(S(A{})); test_contiguous(S("1", A())); test_contiguous(S("1234567890123456789012345678901234567890123456789012345678901234567890", A())); - } + } +#endif + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); #endif return 0; diff --git a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.char.pass.cpp b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.char.pass.cpp index 99c4f2f3375b..9f0f0d796a13 100644 --- a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.char.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.char.pass.cpp @@ -16,9 +16,8 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; S s1 {}; S s2 { "abcde", 5 }; @@ -29,7 +28,17 @@ int main(int, char**) assert (!s1.starts_with('x')); assert ( s2.starts_with('a')); assert (!s2.starts_with('x')); - } + } + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.ptr.pass.cpp b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.ptr.pass.cpp index c50f32c86998..05dd525374ed 100644 --- a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.ptr.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.ptr.pass.cpp @@ -16,9 +16,8 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { + { typedef std::string S; const char *s = "abcde"; S s0 {}; @@ -57,7 +56,17 @@ int main(int, char**) assert (!sNot.starts_with("abcd")); assert (!sNot.starts_with("abcde")); assert ( sNot.starts_with("def")); - } + } + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; } diff --git a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.string_view.pass.cpp index a9856697c00b..22ff1722311d 100644 --- a/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.string_view.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.starts_with/starts_with.string_view.pass.cpp @@ -16,9 +16,7 @@ #include "test_macros.h" -int main(int, char**) -{ - { +bool test() { typedef std::string S; typedef std::string_view SV; const char *s = "abcde"; @@ -67,7 +65,16 @@ int main(int, char**) assert (!sNot.starts_with(sv4)); assert (!sNot.starts_with(sv5)); assert ( sNot.starts_with(svNot)); - } + + return true; +} + +int main(int, char**) +{ + test(); +#if TEST_STD_VER > 17 + // static_assert(test()); +#endif return 0; }