From 26f01c46e92f3b3e09af36b88bee957ad612e5ac Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 6 Dec 2018 13:52:20 +0000 Subject: [libcxx] Make return value of array.data() checked only for libc++ The section array.zero says: "The return value of data() is unspecified". This patch marks all checks of the array.data() return value as libc++ specific. Reviewed as https://reviews.llvm.org/D55364. Thanks to Andrey Maksimov for the patch. llvm-svn: 348485 --- .../test/std/containers/sequences/array/array.data/data.pass.cpp | 8 ++++---- .../std/containers/sequences/array/array.data/data_const.pass.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libcxx/test/std/containers/sequences') 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 436cea4319e..ba2c571ebac 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 @@ -42,7 +42,7 @@ int main() typedef std::array C; C c = {}; T* p = c.data(); - assert(p != nullptr); + LIBCPP_ASSERT(p != nullptr); } { typedef double T; @@ -50,14 +50,14 @@ int main() C c = {{}}; const T* p = c.data(); static_assert((std::is_same::value), ""); - assert(p != nullptr); + LIBCPP_ASSERT(p != nullptr); } { typedef std::max_align_t T; typedef std::array C; const C c = {}; const T* p = c.data(); - assert(p != nullptr); + LIBCPP_ASSERT(p != nullptr); std::uintptr_t pint = reinterpret_cast(p); assert(pint % TEST_ALIGNOF(std::max_align_t) == 0); } @@ -66,6 +66,6 @@ int main() typedef std::array C; C c = {}; T* p = c.data(); - assert(p != nullptr); + LIBCPP_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 0b6c0c48de0..f4635256497 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 @@ -48,14 +48,14 @@ int main() typedef std::array 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 C; const C c = {}; const T* p = c.data(); - assert(p != nullptr); + LIBCPP_ASSERT(p != nullptr); std::uintptr_t pint = reinterpret_cast(p); assert(pint % TEST_ALIGNOF(std::max_align_t) == 0); } -- cgit v1.2.3