[libc++] Prepare string.{access, capacity, cons} tests for constexpr
Reviewed By: ldionne, #libc Spies: libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D119123
This commit is contained in:
1 parent
ca9f0ec1a3
commit
e85018b7dd
42 files changed
+734
-361
No files matched your search
@@ -21,7 +21,7 @@
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class charT>
|
||||
void
|
||||
TEST_CONSTEXPR_CXX20 void
|
||||
test(const charT* s)
|
||||
{
|
||||
typedef std::basic_string<charT, std::char_traits<charT>, test_allocator<charT> > S;
|
||||
@@ -37,7 +37,7 @@ test(const charT* s)
|
||||
}
|
||||
|
||||
template <class charT, class A>
|
||||
void
|
||||
TEST_CONSTEXPR_CXX20 void
|
||||
test(const charT* s, const A& a)
|
||||
{
|
||||
typedef std::basic_string<charT, std::char_traits<charT>, A> S;
|
||||
@@ -51,8 +51,7 @@ test(const charT* s, const A& a)
|
||||
assert(s2.capacity() >= s2.size());
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
bool test() {
|
||||
{
|
||||
typedef test_allocator<char> A;
|
||||
|
||||
@@ -86,5 +85,15 @@ int main(int, char**)
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
test();
|
||||
#if TEST_STD_VER > 17
|
||||
// static_assert(test());
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user