summaryrefslogtreecommitdiff
path: root/test/std/containers/sequences/array/array.data/data.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:35 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:05:35 +0000
commit6012fe9abb1f01b1b5b4ca908464804c21ff8602 (patch)
treea5232179237d9aaa3a03f9c783974fc5f09716c6 /test/std/containers/sequences/array/array.data/data.pass.cpp
parent315d10f09ee888005b1da55e7bbb57d8a79b8447 (diff)
Notes
Diffstat (limited to 'test/std/containers/sequences/array/array.data/data.pass.cpp')
-rw-r--r--test/std/containers/sequences/array/array.data/data.pass.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/std/containers/sequences/array/array.data/data.pass.cpp b/test/std/containers/sequences/array/array.data/data.pass.cpp
index 714894308f00a..ba2c571ebacf0 100644
--- a/test/std/containers/sequences/array/array.data/data.pass.cpp
+++ b/test/std/containers/sequences/array/array.data/data.pass.cpp
@@ -13,12 +13,19 @@
#include <array>
#include <cassert>
+#include <cstddef> // for std::max_align_t
+
#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"
+struct NoDefault {
+ NoDefault(int) {}
+};
+
+
int main()
{
{
@@ -35,7 +42,7 @@ int main()
typedef std::array<T, 0> C;
C c = {};
T* p = c.data();
- assert(p != nullptr);
+ LIBCPP_ASSERT(p != nullptr);
}
{
typedef double T;
@@ -43,25 +50,22 @@ int main()
C c = {{}};
const T* p = c.data();
static_assert((std::is_same<decltype(c.data()), const T*>::value), "");
- assert(p != nullptr);
+ LIBCPP_ASSERT(p != nullptr);
}
{
typedef std::max_align_t T;
typedef std::array<T, 0> C;
const C c = {};
const T* p = c.data();
- assert(p != nullptr);
+ LIBCPP_ASSERT(p != nullptr);
std::uintptr_t pint = reinterpret_cast<std::uintptr_t>(p);
assert(pint % TEST_ALIGNOF(std::max_align_t) == 0);
}
{
- struct NoDefault {
- NoDefault(int) {}
- };
typedef NoDefault T;
typedef std::array<T, 0> C;
C c = {};
T* p = c.data();
- assert(p != nullptr);
+ LIBCPP_ASSERT(p != nullptr);
}
}