Revert "Update aosp/master libcxx rebase to r263688"

The world is burning.

This reverts commit c004fd909c, reversing
changes made to 1418e4163d.
This commit is contained in:
Dan Albert
2016-05-25 22:36:09 -07:00
parent c004fd909c
commit 1d4a1edbc7
1396 changed files with 11495 additions and 38952 deletions

View File

@@ -7,25 +7,17 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <string>
// basic_string(const basic_string<charT,traits,Allocator>& str,
// size_type pos, size_type n,
// const Allocator& a = Allocator());
//
// basic_string(const basic_string<charT,traits,Allocator>& str,
// size_type pos,
// size_type pos, size_type n = npos,
// const Allocator& a = Allocator());
#include <string>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <scoped_allocator>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
@@ -38,7 +30,7 @@ test(S str, unsigned pos)
try
{
S s2(str, pos);
LIBCPP_ASSERT(s2.__invariants());
assert(s2.__invariants());
assert(pos <= str.size());
unsigned rlen = str.size() - pos;
assert(s2.size() == rlen);
@@ -61,7 +53,7 @@ test(S str, unsigned pos, unsigned n)
try
{
S s2(str, pos, n);
LIBCPP_ASSERT(s2.__invariants());
assert(s2.__invariants());
assert(pos <= str.size());
unsigned rlen = std::min<unsigned>(str.size() - pos, n);
assert(s2.size() == rlen);
@@ -84,7 +76,7 @@ test(S str, unsigned pos, unsigned n, const typename S::allocator_type& a)
try
{
S s2(str, pos, n, a);
LIBCPP_ASSERT(s2.__invariants());
assert(s2.__invariants());
assert(pos <= str.size());
unsigned rlen = std::min<unsigned>(str.size() - pos, n);
assert(s2.size() == rlen);
@@ -98,20 +90,6 @@ test(S str, unsigned pos, unsigned n, const typename S::allocator_type& a)
}
}
#if TEST_STD_VER >= 11
void test2583()
{ // LWG #2583
typedef std::basic_string<char, std::char_traits<char>, test_allocator<char> > StringA;
std::vector<StringA, std::scoped_allocator_adaptor<test_allocator<StringA>>> vs;
StringA s{"1234"};
vs.emplace_back(s, 2);
try { vs.emplace_back(s, 5); }
catch (const std::out_of_range&) { return; }
assert(false);
}
#endif
int main()
{
{
@@ -152,7 +130,7 @@ int main()
test(S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), 50, 10, A(8));
test(S("1234567890123456789012345678901234567890123456789012345678901234567890", A(7)), 50, 100, A(8));
}
#if TEST_STD_VER >= 11
#if __cplusplus >= 201103L
{
typedef min_allocator<char> A;
typedef std::basic_string<char, std::char_traits<char>, A> S;
@@ -191,7 +169,5 @@ int main()
test(S("1234567890123456789012345678901234567890123456789012345678901234567890", A()), 50, 10, A());
test(S("1234567890123456789012345678901234567890123456789012345678901234567890", A()), 50, 100, A());
}
test2583();
#endif
}