diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -136,34 +136,19 @@ } }; -#ifndef _LIBCPP_CXX03_LANG - template - struct __array_storage<_Tp, 0> { - union type { - _LIBCPP_CONSTEXPR type() : __b() { } - ~type() = default; - bool __b; - _Tp __t; - }; - - static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - _Tp* __get(type& __storage) _NOEXCEPT { - return &__storage.__t; - } - }; -#else // C++03 template struct __array_storage<_Tp, 0> { typedef typename conditional::value, const char, char>::type _CharType; struct _ArrayInStructT { _Tp __data_[1]; }; - typedef _ALIGNAS_TYPE(_ArrayInStructT) _CharType type[sizeof(_ArrayInStructT)]; + struct _ALIGNAS_TYPE(_ArrayInStructT) type { + _CharType __buffer[sizeof(_ArrayInStructT)]; + }; - static _LIBCPP_INLINE_VISIBILITY - _Tp* __get(type& __storage) _NOEXCEPT { - return reinterpret_cast<_Tp*>(__storage); + static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + _Tp* __get(type&) _NOEXCEPT { + return nullptr; } }; -#endif } // end namespace __detail template 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 --- 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 @@ -34,8 +34,8 @@ struct NonTrivialCopy { TEST_CONSTEXPR NonTrivialCopy() { } - NonTrivialCopy(NonTrivialCopy const&) { } - NonTrivialCopy& operator=(NonTrivialCopy const&) { return *this; } + TEST_CONSTEXPR NonTrivialCopy(NonTrivialCopy const&) { } + TEST_CONSTEXPR_CXX14 NonTrivialCopy& operator=(NonTrivialCopy const&) { return *this; } }; TEST_CONSTEXPR_CXX14 bool tests() 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 --- a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp +++ b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp @@ -49,14 +49,14 @@ typedef std::array C; C c = {}; T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); + (void)p; } { typedef double T; typedef std::array C; C c = {{}}; const T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); + (void)p; static_assert((std::is_same::value), ""); } { @@ -64,7 +64,7 @@ typedef std::array C; C c = {}; T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); + (void)p; } { std::array c = {0, 1, 2, 3, 4}; @@ -92,7 +92,6 @@ typedef std::array C; const C c = {}; const T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); std::uintptr_t pint = reinterpret_cast(p); assert(pint % TEST_ALIGNOF(T) == 0); } 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 --- 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 @@ -49,14 +49,14 @@ typedef std::array C; const C c = {}; const T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); + (void)p; } { typedef NoDefault T; typedef std::array C; const C c = {}; const T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); + (void)p; } { std::array const c = {0, 1, 2, 3, 4}; @@ -84,7 +84,6 @@ typedef std::array C; const C c = {}; const T* p = c.data(); - LIBCPP_ASSERT(p != nullptr); std::uintptr_t pint = reinterpret_cast(p); assert(pint % TEST_ALIGNOF(T) == 0); } diff --git a/libcxx/test/std/containers/sequences/array/iterators.pass.cpp b/libcxx/test/std/containers/sequences/array/iterators.pass.cpp --- a/libcxx/test/std/containers/sequences/array/iterators.pass.cpp +++ b/libcxx/test/std/containers/sequences/array/iterators.pass.cpp @@ -52,8 +52,6 @@ typename C::iterator i = array.begin(); typename C::const_iterator j = array.cbegin(); assert(i == j); - LIBCPP_ASSERT(i != nullptr); - LIBCPP_ASSERT(j != nullptr); } { @@ -63,8 +61,6 @@ typename C::const_iterator j = array.cbegin(); assert(i == array.end()); assert(j == array.cend()); - LIBCPP_ASSERT(i != nullptr); - LIBCPP_ASSERT(j != nullptr); } { typedef std::array C; @@ -101,8 +97,6 @@ typename C::iterator ib = array.begin(); typename C::iterator ie = array.end(); assert(ib == ie); - LIBCPP_ASSERT(ib != nullptr); - LIBCPP_ASSERT(ie != nullptr); } #if TEST_STD_VER >= 14