summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/containers/sequences/array/array.cons/default.pass.cpp17
-rw-r--r--libcxx/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp93
-rw-r--r--libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp18
-rw-r--r--libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp10
-rw-r--r--libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp29
-rw-r--r--libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp30
-rw-r--r--libcxx/test/std/containers/sequences/array/begin.pass.cpp9
7 files changed, 0 insertions, 206 deletions
diff --git a/libcxx/test/std/containers/sequences/array/array.cons/default.pass.cpp b/libcxx/test/std/containers/sequences/array/array.cons/default.pass.cpp
index 9a2a6eaa307..7bc62b759c3 100644
--- a/libcxx/test/std/containers/sequences/array/array.cons/default.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.cons/default.pass.cpp
@@ -14,14 +14,6 @@
#include <array>
#include <cassert>
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-struct NoDefault {
- NoDefault(int) {}
-};
-
int main()
{
{
@@ -36,13 +28,4 @@ int main()
C c;
assert(c.size() == 0);
}
- {
- typedef std::array<NoDefault, 0> C;
- C c;
- assert(c.size() == 0);
- C c1 = {};
- assert(c1.size() == 0);
- C c2 = {{}};
- assert(c2.size() == 0);
- }
}
diff --git a/libcxx/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp b/libcxx/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp
deleted file mode 100644
index a8434c01894..00000000000
--- a/libcxx/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp
+++ /dev/null
@@ -1,93 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <array>
-
-// implicitly generated array constructors / assignment operators
-
-#include <array>
-#include <type_traits>
-#include <cassert>
-#include "test_macros.h"
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-// In C++03 the copy assignment operator is not deleted when the implicitly
-// generated operator would be ill-formed; like in the case of a struct with a
-// const member.
-#if TEST_STD_VER < 11
-#define TEST_NOT_COPY_ASSIGNABLE(T) ((void)0)
-#else
-#define TEST_NOT_COPY_ASSIGNABLE(T) static_assert(!std::is_copy_assignable<T>::value, "")
-#endif
-
-struct NoDefault {
- NoDefault(int) {}
-};
-
-int main() {
- {
- typedef double T;
- typedef std::array<T, 3> C;
- C c = {1.1, 2.2, 3.3};
- C c2 = c;
- c2 = c;
- static_assert(std::is_copy_constructible<C>::value, "");
- static_assert(std::is_copy_assignable<C>::value, "");
- }
- {
- typedef double T;
- typedef std::array<const T, 3> C;
- C c = {1.1, 2.2, 3.3};
- C c2 = c;
- ((void)c2);
- static_assert(std::is_copy_constructible<C>::value, "");
- TEST_NOT_COPY_ASSIGNABLE(C);
- }
- {
- typedef double T;
- typedef std::array<T, 0> C;
- C c = {};
- C c2 = c;
- c2 = c;
- static_assert(std::is_copy_constructible<C>::value, "");
- static_assert(std::is_copy_assignable<C>::value, "");
- }
- {
- // const arrays of size 0 should disable the implicit copy assignment operator.
- typedef double T;
- typedef std::array<const T, 0> C;
- C c = {};
- C c2 = c;
- ((void)c2);
- static_assert(std::is_copy_constructible<C>::value, "");
- TEST_NOT_COPY_ASSIGNABLE(C);
- }
- {
- typedef NoDefault T;
- typedef std::array<T, 0> C;
- C c = {};
- C c2 = c;
- c2 = c;
- static_assert(std::is_copy_constructible<C>::value, "");
- static_assert(std::is_copy_assignable<C>::value, "");
- }
- {
- typedef NoDefault T;
- typedef std::array<const T, 0> C;
- C c = {};
- C c2 = c;
- ((void)c2);
- static_assert(std::is_copy_constructible<C>::value, "");
- TEST_NOT_COPY_ASSIGNABLE(C);
- }
-
-}
diff --git a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
index 452d6b7f3ca..d7aed70c98a 100644
--- a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
@@ -36,22 +36,4 @@ int main()
T* p = c.data();
(void)p; // to placate scan-build
}
- {
- typedef double T;
- typedef std::array<const T, 0> C;
- C c = {};
- const T* p = c.data();
- static_assert((std::is_same<decltype(c.data()), const T*>::value), "");
- (void)p; // to placate scan-build
- }
- {
- struct NoDefault {
- NoDefault(int) {}
- };
- typedef NoDefault T;
- typedef std::array<T, 0> C;
- C c = {};
- T* p = c.data();
- assert(p != nullptr);
- }
}
diff --git a/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
index f10d51580dd..5be082eeb84 100644
--- a/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
@@ -38,16 +38,6 @@ int main()
const T* p = c.data();
(void)p; // to placate scan-build
}
- {
- struct NoDefault {
- NoDefault(int) {}
- };
- typedef NoDefault T;
- typedef std::array<T, 0> C;
- const C c = {};
- const T* p = c.data();
- assert(p != nullptr);
- }
#if TEST_STD_VER > 14
{
typedef std::array<int, 5> C;
diff --git a/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp b/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
deleted file mode 100644
index 07816c7c75a..00000000000
--- a/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
+++ /dev/null
@@ -1,29 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <array>
-
-// void fill(const T& u);
-
-#include <array>
-#include <cassert>
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-int main() {
- {
- typedef double T;
- typedef std::array<const T, 0> C;
- C c = {};
- // expected-error@array:* {{static_assert failed "cannot fill zero-sized array of type 'const T'"}}
- c.fill(5.5); // expected-note {{requested here}}
- }
-}
diff --git a/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp b/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
deleted file mode 100644
index 26febadb7f1..00000000000
--- a/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
+++ /dev/null
@@ -1,30 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// <array>
-
-// void swap(array& a);
-
-#include <array>
-#include <cassert>
-
-// std::array is explicitly allowed to be initialized with A a = { init-list };.
-// Disable the missing braces warning for this reason.
-#include "disable_missing_braces_warning.h"
-
-int main() {
- {
- typedef double T;
- typedef std::array<const T, 0> C;
- C c = {};
- C c2 = {};
- // expected-error@array:* {{static_assert failed "cannot swap zero-sized array of type 'const T'"}}
- c.swap(c2); // expected-note {{requested here}}
- }
-}
diff --git a/libcxx/test/std/containers/sequences/array/begin.pass.cpp b/libcxx/test/std/containers/sequences/array/begin.pass.cpp
index 8cdef466a8f..b12ffc851b8 100644
--- a/libcxx/test/std/containers/sequences/array/begin.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/begin.pass.cpp
@@ -31,13 +31,4 @@ int main()
*i = 5.5;
assert(c[0] == 5.5);
}
- {
- struct NoDefault {
- NoDefault(int) {}
- };
- typedef NoDefault T;
- typedef std::array<T, 0> C;
- C c = {};
- assert(c.begin() == c.end());
- }
}
OpenPOWER on IntegriCloud