Revert "Revert "Update aosp/master libcxx rebase to r263688""
This reverts commit 1d4a1edbc7.
Change-Id: I2909937fe582f2c5552bc86e7f4d2d5cff0de0aa
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator position) with end()
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S::const_iterator i = l1.end();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,52 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator position) with iterator from another container
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string l2("123");
|
||||
std::string::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S l2("123");
|
||||
S::const_iterator i = l2.begin();
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,50 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator first, const_iterator last); with first iterator from another container
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string l2("123");
|
||||
std::string::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S l2("123");
|
||||
S::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,50 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator first, const_iterator last); with second iterator from another container
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string l2("123");
|
||||
std::string::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S l2("123");
|
||||
S::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,50 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator first, const_iterator last); with both iterators from another container
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string l2("123");
|
||||
std::string::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S l2("123");
|
||||
S::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,48 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <string>
|
||||
|
||||
// Call erase(const_iterator first, const_iterator last); with a bad range
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
std::string l1("123");
|
||||
std::string::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
S::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -22,7 +23,7 @@ test(S s, typename S::difference_type pos, S expected)
|
||||
{
|
||||
typename S::const_iterator p = s.begin() + pos;
|
||||
typename S::iterator i = s.erase(p);
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s == expected);
|
||||
assert(i - s.begin() == pos);
|
||||
}
|
||||
@@ -44,7 +45,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 10, S("abcdefghijlmnopqrst"));
|
||||
test(S("abcdefghijklmnopqrst"), 19, S("abcdefghijklmnopqrs"));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S("abcde"), 0, S("bcde"));
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -23,7 +24,7 @@ test(S s, typename S::difference_type pos, typename S::difference_type n, S expe
|
||||
typename S::const_iterator first = s.cbegin() + pos;
|
||||
typename S::const_iterator last = s.cbegin() + pos + n;
|
||||
typename S::iterator i = s.erase(first, last);
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s == expected);
|
||||
assert(i - s.begin() == pos);
|
||||
}
|
||||
@@ -87,7 +88,7 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), 19, 1, S("abcdefghijklmnopqrs"));
|
||||
test(S("abcdefghijklmnopqrst"), 20, 0, S("abcdefghijklmnopqrst"));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, 0, S(""));
|
||||
|
||||
@@ -11,13 +11,10 @@
|
||||
|
||||
// void pop_back();
|
||||
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -25,7 +22,7 @@ void
|
||||
test(S s, S expected)
|
||||
{
|
||||
s.pop_back();
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s == expected);
|
||||
}
|
||||
|
||||
@@ -37,7 +34,7 @@ int main()
|
||||
test(S("abcdefghij"), S("abcdefghi"));
|
||||
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrs"));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S("abcde"), S("abcd"));
|
||||
@@ -45,11 +42,4 @@ int main()
|
||||
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrs"));
|
||||
}
|
||||
#endif
|
||||
#if _LIBCPP_DEBUG >= 1
|
||||
{
|
||||
std::string s;
|
||||
s.pop_back();
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: libcpp-no-exceptions
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
@@ -16,6 +17,7 @@
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
template <class S>
|
||||
@@ -27,7 +29,7 @@ test(S s, typename S::size_type pos, typename S::size_type n, S expected)
|
||||
try
|
||||
{
|
||||
s.erase(pos, n);
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -47,7 +49,7 @@ test(S s, typename S::size_type pos, S expected)
|
||||
try
|
||||
{
|
||||
s.erase(pos);
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(pos <= old_size);
|
||||
assert(s == expected);
|
||||
}
|
||||
@@ -63,7 +65,7 @@ void
|
||||
test(S s, S expected)
|
||||
{
|
||||
s.erase();
|
||||
assert(s.__invariants());
|
||||
LIBCPP_ASSERT(s.__invariants());
|
||||
assert(s == expected);
|
||||
}
|
||||
|
||||
@@ -172,7 +174,7 @@ int main()
|
||||
test(S("abcdefghij"), S(""));
|
||||
test(S("abcdefghijklmnopqrst"), S(""));
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
test(S(""), 0, 0, S(""));
|
||||
|
||||
Reference in New Issue
Block a user