[libcxx] [test] Untabify, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephan T. Lavavej
2017-07-29 00:55:10 +00:00
parent 62e519c2f9
commit a686caad20
121 changed files with 786 additions and 786 deletions

View File

@@ -24,9 +24,9 @@ test()
{
{
#if TEST_STD_VER > 14
static_assert((noexcept(S{})), "" );
static_assert((noexcept(S{})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S()) == noexcept(typename S::allocator_type())), "" );
static_assert((noexcept(S()) == noexcept(typename S::allocator_type())), "" );
#endif
S s;
LIBCPP_ASSERT(s.__invariants());
@@ -37,9 +37,9 @@ test()
}
{
#if TEST_STD_VER > 14
static_assert((noexcept(S{typename S::allocator_type{}})), "" );
static_assert((noexcept(S{typename S::allocator_type{}})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S(typename S::allocator_type())) == std::is_nothrow_copy_constructible<typename S::allocator_type>::value), "" );
static_assert((noexcept(S(typename S::allocator_type())) == std::is_nothrow_copy_constructible<typename S::allocator_type>::value), "" );
#endif
S s(typename S::allocator_type(5));
LIBCPP_ASSERT(s.__invariants());
@@ -58,9 +58,9 @@ test2()
{
{
#if TEST_STD_VER > 14
static_assert((noexcept(S{})), "" );
static_assert((noexcept(S{})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S()) == noexcept(typename S::allocator_type())), "" );
static_assert((noexcept(S()) == noexcept(typename S::allocator_type())), "" );
#endif
S s;
LIBCPP_ASSERT(s.__invariants());
@@ -71,9 +71,9 @@ test2()
}
{
#if TEST_STD_VER > 14
static_assert((noexcept(S{typename S::allocator_type{}})), "" );
static_assert((noexcept(S{typename S::allocator_type{}})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S(typename S::allocator_type())) == std::is_nothrow_copy_constructible<typename S::allocator_type>::value), "" );
static_assert((noexcept(S(typename S::allocator_type())) == std::is_nothrow_copy_constructible<typename S::allocator_type>::value), "" );
#endif
S s(typename S::allocator_type{});
LIBCPP_ASSERT(s.__invariants());

View File

@@ -69,9 +69,9 @@ bool operator!=(const poca_alloc<T>& lhs, const poca_alloc<U>& rhs)
template <class S>
void test_assign(S &s1, const S& s2)
{
try { s1 = s2; }
catch ( std::bad_alloc &) { return; }
assert(false);
try { s1 = s2; }
catch ( std::bad_alloc &) { return; }
assert(false);
}
#endif
@@ -110,21 +110,21 @@ int main()
{
typedef poca_alloc<char> A;
typedef std::basic_string<char, std::char_traits<char>, A> S;
const char * p1 = "This is my first string";
const char * p2 = "This is my second string";
const char * p1 = "This is my first string";
const char * p2 = "This is my second string";
alloc_imp<char> imp1;
alloc_imp<char> imp2;
S s1(p1, A(&imp1));
S s2(p2, A(&imp2));
S s1(p1, A(&imp1));
S s2(p2, A(&imp2));
assert(s1 == p1);
assert(s2 == p2);
assert(s1 == p1);
assert(s2 == p2);
imp2.deactivate();
test_assign(s1, s2);
assert(s1 == p1);
assert(s2 == p2);
imp2.deactivate();
test_assign(s1, s2);
assert(s1 == p1);
assert(s2 == p2);
}
#endif
#endif

View File

@@ -41,9 +41,9 @@ int main()
typedef test_allocator<char> A;
typedef std::basic_string<char, std::char_traits<char>, A> S;
#if TEST_STD_VER > 14
static_assert((noexcept(S{})), "" );
static_assert((noexcept(S{})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
#endif
test(S(), A(3));
test(S("1"), A(5));
@@ -55,9 +55,9 @@ int main()
typedef test_allocator<char> A;
typedef std::basic_string<char, std::char_traits<char>, A> S;
#if TEST_STD_VER > 14
static_assert((noexcept(S{})), "" );
static_assert((noexcept(S{})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
#endif
S s1 ( "Twas brillig, and the slivy toves did gyre and gymbal in the wabe" );
S s2 (std::move(s1), A(1));
@@ -67,9 +67,9 @@ int main()
typedef min_allocator<char> A;
typedef std::basic_string<char, std::char_traits<char>, A> S;
#if TEST_STD_VER > 14
static_assert((noexcept(S{})), "" );
static_assert((noexcept(S{})), "" );
#elif TEST_STD_VER >= 11
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
static_assert((noexcept(S()) == std::is_nothrow_move_constructible<A>::value), "" );
#endif
test(S(), A());
test(S("1"), A());

View File

@@ -16,7 +16,7 @@
// allocator_traits<allocator_type>::propagate_on_container_move_assignment::value ||
// allocator_traits<allocator_type>::is_always_equal::value); // C++17
//
// before C++17, we use the conforming extension
// before C++17, we use the conforming extension
// noexcept(
// allocator_type::propagate_on_container_move_assignment::value &&
// is_nothrow_move_assignable<allocator_type>::value);
@@ -81,12 +81,12 @@ int main()
}
#if TEST_STD_VER > 14
{
// POCMA is false, always equal
// POCMA is false, always equal
typedef std::basic_string<char, std::char_traits<char>, some_alloc2<char>> C;
static_assert( std::is_nothrow_move_assignable<C>::value, "");
}
{
// POCMA is false, not always equal
// POCMA is false, not always equal
typedef std::basic_string<char, std::char_traits<char>, some_alloc3<char>> C;
static_assert(!std::is_nothrow_move_assignable<C>::value, "");
}

View File

@@ -18,6 +18,6 @@ void foo ( const string &s ) {}
int main()
{
std::string_view sv = "ABCDE";
foo(sv); // requires implicit conversion from string_view to string
std::string_view sv = "ABCDE";
foo(sv); // requires implicit conversion from string_view to string
}