summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2018-12-06 13:52:20 +0000
committerLouis Dionne <ldionne@apple.com>2018-12-06 13:52:20 +0000
commit26f01c46e92f3b3e09af36b88bee957ad612e5ac (patch)
treeb827973c03c9891649ea245c88a3847eb8fe9650 /libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
parentcb5331eb932c1367e8396378eaa976f38d5f3688 (diff)
downloadbcm5719-llvm-26f01c46e92f3b3e09af36b88bee957ad612e5ac.tar.gz
bcm5719-llvm-26f01c46e92f3b3e09af36b88bee957ad612e5ac.zip
[libcxx] Make return value of array<T, 0>.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<T, 0>.data() return value as libc++ specific. Reviewed as https://reviews.llvm.org/D55364. Thanks to Andrey Maksimov for the patch. llvm-svn: 348485
Diffstat (limited to 'libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp')
-rw-r--r--libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp8
1 files changed, 4 insertions, 4 deletions
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<T, 0> 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<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);
}
@@ -66,6 +66,6 @@ int main()
typedef std::array<T, 0> C;
C c = {};
T* p = c.data();
- assert(p != nullptr);
+ LIBCPP_ASSERT(p != nullptr);
}
}
OpenPOWER on IntegriCloud