[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:
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::map<int, int, Comp<int> > m;
|
||||
std::map<int, int, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::multimap<int, int, Comp<int> > m;
|
||||
std::multimap<int, int, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::multiset<int, Comp<int> > m;
|
||||
std::multiset<int, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::set<int, Comp<int> > m;
|
||||
std::set<int, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@
|
||||
int main()
|
||||
{
|
||||
// LWG#2566 says that the first template param must match the second one's value type
|
||||
std::priority_queue<double, std::deque<int>> t;
|
||||
std::priority_queue<double, std::deque<int>> t;
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
int main()
|
||||
{
|
||||
// LWG#2566 says that the first template param must match the second one's value type
|
||||
std::queue<double, std::deque<int>> t;
|
||||
std::queue<double, std::deque<int>> t;
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@
|
||||
int main()
|
||||
{
|
||||
// LWG#2566 says that the first template param must match the second one's value type
|
||||
std::stack<double, std::deque<int>> t;
|
||||
std::stack<double, std::deque<int>> t;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
constexpr bool check_idx( size_t idx, double val )
|
||||
{
|
||||
std::array<double, 3> arr = {1, 2, 3.5};
|
||||
return arr.at(idx) == val;
|
||||
return arr.at(idx) == val;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
constexpr bool check_front( double val )
|
||||
{
|
||||
std::array<double, 3> arr = {1, 2, 3.5};
|
||||
return arr.front() == val;
|
||||
return arr.front() == val;
|
||||
}
|
||||
|
||||
constexpr bool check_back( double val )
|
||||
{
|
||||
std::array<double, 3> arr = {1, 2, 3.5};
|
||||
return arr.back() == val;
|
||||
return arr.back() == val;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
constexpr bool check_idx( size_t idx, double val )
|
||||
{
|
||||
std::array<double, 3> arr = {1, 2, 3.5};
|
||||
return arr[idx] == val;
|
||||
return arr[idx] == val;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -80,17 +80,17 @@ int main()
|
||||
assert(false);
|
||||
}
|
||||
catch (...) {
|
||||
gCopyConstructorShouldThow = false;
|
||||
gCopyConstructorShouldThow = false;
|
||||
assert(vec==vec2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
|
||||
{
|
||||
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
|
||||
C vec;
|
||||
C vec2(vec);
|
||||
|
||||
C::allocator_type::throw_after = 1;
|
||||
C::allocator_type::throw_after = 1;
|
||||
try {
|
||||
vec.push_back(instance);
|
||||
assert(false);
|
||||
|
||||
@@ -80,17 +80,17 @@ int main()
|
||||
assert(false);
|
||||
}
|
||||
catch (...) {
|
||||
gCopyConstructorShouldThow = false;
|
||||
gCopyConstructorShouldThow = false;
|
||||
assert(vec==vec2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
|
||||
{
|
||||
typedef std::deque<CMyClass, test_allocator<CMyClass> > C;
|
||||
C vec;
|
||||
C vec2(vec);
|
||||
|
||||
C::allocator_type::throw_after = 1;
|
||||
C::allocator_type::throw_after = 1;
|
||||
try {
|
||||
vec.push_front(instance);
|
||||
assert(false);
|
||||
|
||||
@@ -31,8 +31,8 @@ struct A { std::list<A> v; }; // incomplete type support
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef std::list<int> C;
|
||||
{
|
||||
typedef std::list<int> C;
|
||||
static_assert((std::is_same<C::value_type, int>::value), "");
|
||||
static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
|
||||
static_assert((std::is_same<C::reference, std::allocator<int>::reference>::value), "");
|
||||
@@ -46,11 +46,11 @@ int main()
|
||||
typename std::iterator_traits<typename C::iterator>::difference_type>::value), "");
|
||||
static_assert((std::is_same<typename C::difference_type,
|
||||
typename std::iterator_traits<typename C::const_iterator>::difference_type>::value), "");
|
||||
}
|
||||
}
|
||||
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::list<int, min_allocator<int>> C;
|
||||
typedef std::list<int, min_allocator<int>> C;
|
||||
static_assert((std::is_same<C::value_type, int>::value), "");
|
||||
static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
|
||||
static_assert((std::is_same<C::reference, int&>::value), "");
|
||||
|
||||
@@ -24,9 +24,9 @@ void
|
||||
test0()
|
||||
{
|
||||
#if TEST_STD_VER > 14
|
||||
static_assert((noexcept(C{})), "" );
|
||||
static_assert((noexcept(C{})), "" );
|
||||
#elif TEST_STD_VER >= 11
|
||||
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
|
||||
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
|
||||
#endif
|
||||
C c;
|
||||
LIBCPP_ASSERT(c.__invariants());
|
||||
@@ -45,9 +45,9 @@ void
|
||||
test1(const typename C::allocator_type& a)
|
||||
{
|
||||
#if TEST_STD_VER > 14
|
||||
static_assert((noexcept(C{typename C::allocator_type{}})), "" );
|
||||
static_assert((noexcept(C{typename C::allocator_type{}})), "" );
|
||||
#elif TEST_STD_VER >= 11
|
||||
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
|
||||
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
|
||||
#endif
|
||||
C c(a);
|
||||
LIBCPP_ASSERT(c.__invariants());
|
||||
|
||||
@@ -23,17 +23,17 @@ int main()
|
||||
bool a[] = {false, true, false, true};
|
||||
bool* an = a + sizeof(a)/sizeof(a[0]);
|
||||
|
||||
std::vector<bool> v(a, an);
|
||||
std::vector<bool>::reference r1 = v[0];
|
||||
std::vector<bool>::reference r2 = v[3];
|
||||
std::vector<bool> v(a, an);
|
||||
std::vector<bool>::reference r1 = v[0];
|
||||
std::vector<bool>::reference r2 = v[3];
|
||||
|
||||
#if TEST_STD_VER >= 11
|
||||
static_assert((noexcept(v.swap(r1,r2))), "");
|
||||
#endif
|
||||
|
||||
assert(!r1);
|
||||
assert( r2);
|
||||
v.swap(r1, r2);
|
||||
assert( r1);
|
||||
assert(!r2);
|
||||
assert(!r1);
|
||||
assert( r2);
|
||||
v.swap(r1, r2);
|
||||
assert( r1);
|
||||
assert(!r2);
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ void
|
||||
test0()
|
||||
{
|
||||
#if TEST_STD_VER > 14
|
||||
static_assert((noexcept(C{})), "" );
|
||||
static_assert((noexcept(C{})), "" );
|
||||
#elif TEST_STD_VER >= 11
|
||||
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
|
||||
static_assert((noexcept(C()) == noexcept(typename C::allocator_type())), "" );
|
||||
#endif
|
||||
C c;
|
||||
LIBCPP_ASSERT(c.__invariants());
|
||||
@@ -50,9 +50,9 @@ void
|
||||
test1(const typename C::allocator_type& a)
|
||||
{
|
||||
#if TEST_STD_VER > 14
|
||||
static_assert((noexcept(C{typename C::allocator_type{}})), "" );
|
||||
static_assert((noexcept(C{typename C::allocator_type{}})), "" );
|
||||
#elif TEST_STD_VER >= 11
|
||||
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
|
||||
static_assert((noexcept(C(typename C::allocator_type())) == std::is_nothrow_copy_constructible<typename C::allocator_type>::value), "" );
|
||||
#endif
|
||||
C c(a);
|
||||
LIBCPP_ASSERT(c.__invariants());
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#include "asan_testing.h"
|
||||
|
||||
struct Nasty {
|
||||
Nasty() : i_(0) {}
|
||||
Nasty(int i) : i_(i) {}
|
||||
~Nasty() {}
|
||||
Nasty() : i_(0) {}
|
||||
Nasty(int i) : i_(i) {}
|
||||
~Nasty() {}
|
||||
|
||||
Nasty * operator&() const { assert(false); return nullptr; }
|
||||
int i_;
|
||||
};
|
||||
Nasty * operator&() const { assert(false); return nullptr; }
|
||||
int i_;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#include "asan_testing.h"
|
||||
|
||||
struct Nasty {
|
||||
Nasty() : i_(0) {}
|
||||
Nasty(int i) : i_(i) {}
|
||||
~Nasty() {}
|
||||
Nasty() : i_(0) {}
|
||||
Nasty(int i) : i_(i) {}
|
||||
~Nasty() {}
|
||||
|
||||
Nasty * operator&() const { assert(false); return nullptr; }
|
||||
int i_;
|
||||
};
|
||||
Nasty * operator&() const { assert(false); return nullptr; }
|
||||
int i_;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
template <class C>
|
||||
void rehash_postcondition(const C& c, size_t n)
|
||||
{
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_map<int, int, std::hash<int>, Comp<int> > m;
|
||||
std::unordered_map<int, int, std::hash<int>, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Hash {
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
|
||||
Hash () {}
|
||||
Hash () {}
|
||||
private:
|
||||
Hash (const Hash &); // declared but not defined
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_map<int, int, Hash<int> > m;
|
||||
std::unordered_map<int, int, Hash<int> > m;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ struct some_alloc3
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef std::pair<const MoveOnly, MoveOnly> MapType;
|
||||
typedef std::pair<const MoveOnly, MoveOnly> MapType;
|
||||
{
|
||||
typedef std::unordered_map<MoveOnly, MoveOnly> C;
|
||||
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
template <class C>
|
||||
void rehash_postcondition(const C& c, size_t n)
|
||||
{
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_multimap<int, int, std::hash<int>, Comp<int> > m;
|
||||
std::unordered_multimap<int, int, std::hash<int>, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Hash {
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
|
||||
Hash () {}
|
||||
Hash () {}
|
||||
private:
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_multimap<int, int, Hash<int> > m;
|
||||
std::unordered_multimap<int, int, Hash<int> > m;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
template <class C>
|
||||
void rehash_postcondition(const C& c, size_t n)
|
||||
{
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_multiset<int, std::hash<int>, Comp<int> > m;
|
||||
std::unordered_multiset<int, std::hash<int>, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Hash {
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
|
||||
Hash () {}
|
||||
Hash () {}
|
||||
private:
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_multiset<int, Hash<int> > m;
|
||||
std::unordered_multiset<int, Hash<int> > m;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
template <class C>
|
||||
void rehash_postcondition(const C& c, size_t n)
|
||||
{
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
assert(c.bucket_count() >= c.size() / c.max_load_factor() && c.bucket_count() >= n);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Comp {
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
|
||||
|
||||
Comp () {}
|
||||
Comp () {}
|
||||
private:
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
Comp (const Comp &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_set<int, std::hash<int>, Comp<int> > m;
|
||||
std::unordered_set<int, std::hash<int>, Comp<int> > m;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ int main()
|
||||
assert(c.max_load_factor() == 1);
|
||||
}
|
||||
{
|
||||
A a;
|
||||
A a;
|
||||
C c(a);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 0);
|
||||
assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
template <class T>
|
||||
struct Hash {
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
std::size_t operator () (const T& lhs) const { return 0; }
|
||||
|
||||
Hash () {}
|
||||
Hash () {}
|
||||
private:
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
Hash (const Hash &); // declared but not defined
|
||||
};
|
||||
|
||||
|
||||
int main() {
|
||||
std::unordered_set<int, Hash<int> > m;
|
||||
std::unordered_set<int, Hash<int> > m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user