Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// void assign(initializer_list<value_type> il);
|
||||
@@ -18,7 +20,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::list<int> d;
|
||||
d.assign({3, 4, 5, 6});
|
||||
@@ -29,7 +30,6 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<int, min_allocator<int>> d;
|
||||
d.assign({3, 4, 5, 6});
|
||||
@@ -40,6 +40,4 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// list& operator=(list&& c);
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
||||
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
||||
@@ -62,7 +63,6 @@ int main()
|
||||
assert(l.empty());
|
||||
assert(l2.get_allocator() == lo.get_allocator());
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
||||
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
||||
@@ -77,6 +77,4 @@ int main()
|
||||
assert(l.empty());
|
||||
assert(l2.get_allocator() == lo.get_allocator());
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// list(initializer_list<value_type> il);
|
||||
@@ -18,7 +20,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::list<int> d = {3, 4, 5, 6};
|
||||
assert(d.size() == 4);
|
||||
@@ -28,7 +29,6 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
|
||||
assert(d.size() == 4);
|
||||
@@ -38,6 +38,4 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// list(initializer_list<value_type> il, const Allocator& a = allocator_type());
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
|
||||
assert(d.get_allocator() == test_allocator<int>(3));
|
||||
@@ -30,7 +31,6 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
|
||||
assert(d.get_allocator() == min_allocator<int>());
|
||||
@@ -41,6 +41,4 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// list(list&& c, const allocator_type& a);
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
|
||||
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
|
||||
@@ -59,7 +60,6 @@ int main()
|
||||
assert(!l.empty());
|
||||
assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
|
||||
std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
|
||||
@@ -73,6 +73,4 @@ int main()
|
||||
assert(l.empty());
|
||||
assert(l2.get_allocator() == min_allocator<MoveOnly>());
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// list& operator=(initializer_list<value_type> il);
|
||||
@@ -17,7 +19,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::list<int> d;
|
||||
d = {3, 4, 5, 6};
|
||||
@@ -28,7 +29,6 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<int, min_allocator<int>> d;
|
||||
d = {3, 4, 5, 6};
|
||||
@@ -39,6 +39,4 @@ int main()
|
||||
assert(*i++ == 5);
|
||||
assert(*i++ == 6);
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// iterator insert(const_iterator p, initializer_list<value_type> il);
|
||||
@@ -18,7 +20,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::list<int> d(10, 1);
|
||||
std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
||||
@@ -40,7 +41,6 @@ int main()
|
||||
assert(*i++ == 1);
|
||||
assert(*i++ == 1);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<int, min_allocator<int>> d(10, 1);
|
||||
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
|
||||
@@ -62,6 +62,4 @@ int main()
|
||||
assert(*i++ == 1);
|
||||
assert(*i++ == 1);
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// void push_back(value_type&& x);
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
std::list<MoveOnly> l1;
|
||||
l1.push_back(MoveOnly(1));
|
||||
@@ -30,7 +31,6 @@ int main()
|
||||
assert(l1.front() == MoveOnly(1));
|
||||
assert(l1.back() == MoveOnly(2));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
||||
l1.push_back(MoveOnly(1));
|
||||
@@ -41,6 +41,4 @@ int main()
|
||||
assert(l1.front() == MoveOnly(1));
|
||||
assert(l1.back() == MoveOnly(2));
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <list>
|
||||
|
||||
// void push_front(value_type&& x);
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
{
|
||||
std::list<MoveOnly> l1;
|
||||
l1.push_front(MoveOnly(1));
|
||||
@@ -30,7 +31,6 @@ int main()
|
||||
assert(l1.front() == MoveOnly(2));
|
||||
assert(l1.back() == MoveOnly(1));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
std::list<MoveOnly, min_allocator<MoveOnly>> l1;
|
||||
l1.push_front(MoveOnly(1));
|
||||
@@ -41,6 +41,4 @@ int main()
|
||||
assert(l1.front() == MoveOnly(2));
|
||||
assert(l1.back() == MoveOnly(1));
|
||||
}
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user