[PATCH] D21874: [libcxx] [test] std::array's iterators aren't guaranteed to be pointers.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 29 16:30:48 PDT 2016
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
std::array's iterators aren't guaranteed to be pointers.
Include test_macros.h and mark these static_asserts as libcxx-specific.
http://reviews.llvm.org/D21874
Files:
test/std/containers/sequences/array/types.pass.cpp
Index: test/std/containers/sequences/array/types.pass.cpp
===================================================================
--- test/std/containers/sequences/array/types.pass.cpp
+++ test/std/containers/sequences/array/types.pass.cpp
@@ -29,15 +29,17 @@
#include <iterator>
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
{
typedef double T;
typedef std::array<T, 10> C;
static_assert((std::is_same<C::reference, T&>::value), "");
static_assert((std::is_same<C::const_reference, const T&>::value), "");
- static_assert((std::is_same<C::iterator, T*>::value), "");
- static_assert((std::is_same<C::const_iterator, const T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::iterator, T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::const_iterator, const T*>::value), "");
static_assert((std::is_same<C::pointer, T*>::value), "");
static_assert((std::is_same<C::const_pointer, const T*>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::value), "");
@@ -57,8 +59,8 @@
typedef std::array<T, 0> C;
static_assert((std::is_same<C::reference, T&>::value), "");
static_assert((std::is_same<C::const_reference, const T&>::value), "");
- static_assert((std::is_same<C::iterator, T*>::value), "");
- static_assert((std::is_same<C::const_iterator, const T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::iterator, T*>::value), "");
+ LIBCPP_STATIC_ASSERT((std::is_same<C::const_iterator, const T*>::value), "");
static_assert((std::is_same<C::pointer, T*>::value), "");
static_assert((std::is_same<C::const_pointer, const T*>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::value), "");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21874.62307.patch
Type: text/x-patch
Size: 1841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160629/74831b33/attachment.bin>
More information about the cfe-commits
mailing list