diff options
Diffstat (limited to 'test/std/containers/sequences/array/array.data/data_const.pass.cpp')
| -rw-r--r-- | test/std/containers/sequences/array/array.data/data_const.pass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp index b99bf6af8627..f46352564973 100644 --- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp +++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp @@ -13,6 +13,7 @@ #include <array> #include <cassert> +#include <cstddef> // for std::max_align_t #include "test_macros.h" @@ -20,6 +21,10 @@ // Disable the missing braces warning for this reason. #include "disable_missing_braces_warning.h" +struct NoDefault { + NoDefault(int) {} +}; + int main() { { @@ -39,21 +44,18 @@ int main() (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); + 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); } |
