mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,9 +15,8 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int sign(int x)
|
||||
{
|
||||
@@ -378,4 +377,11 @@ int main()
|
||||
test2<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.compare(0, 1, {"abc", 1}) < 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int sign(int x)
|
||||
@@ -74,4 +75,11 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.compare({"abc", 1}) < 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.find_first_not_of({"abc", 1}) == 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.find_first_of({"abc", 1}) == std::string::npos);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.find_last_not_of({"abc", 1}) == s.size() - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.find_last_of({"abc", 1}) == std::string::npos);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.find({"abc", 1}) == std::string::npos);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -154,4 +155,11 @@ int main()
|
||||
test1<S>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TEST_STD_VER > 3
|
||||
{ // LWG 2946
|
||||
std::string s = " !";
|
||||
assert(s.rfind({"abc", 1}) == std::string::npos);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user