[PATCH] D21875: [libcxx] [test] The Standard requires meow_insert_iterator::reference to be void.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 16:33:58 PDT 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

The Standard requires meow_insert_iterator::reference to be void.

This is a libcxx product and test bug, since the type is observable. Mark these static_asserts as libcxx-specific, because MSVC follows the Standard strictly here.

http://reviews.llvm.org/D21875

Files:
  test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/types.pass.cpp
  test/std/iterators/predef.iterators/insert.iterators/front.insert.iterator/types.pass.cpp
  test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp

Index: test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
===================================================================
--- test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
+++ test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
@@ -30,6 +30,8 @@
 #include <type_traits>
 #include <vector>
 
+#include "test_macros.h"
+
 template <class C>
 struct find_members
     : private std::insert_iterator<C>
@@ -53,7 +55,7 @@
     static_assert((std::is_same<typename R::container_type, C>::value), "");
     static_assert((std::is_same<typename R::value_type, void>::value), "");
     static_assert((std::is_same<typename R::difference_type, void>::value), "");
-    static_assert((std::is_same<typename R::reference, R&>::value), "");
+    LIBCPP_STATIC_ASSERT((std::is_same<typename R::reference, R&>::value), "");
     static_assert((std::is_same<typename R::pointer, void>::value), "");
     static_assert((std::is_same<typename R::iterator_category, std::output_iterator_tag>::value), "");
 }
Index: test/std/iterators/predef.iterators/insert.iterators/front.insert.iterator/types.pass.cpp
===================================================================
--- test/std/iterators/predef.iterators/insert.iterators/front.insert.iterator/types.pass.cpp
+++ test/std/iterators/predef.iterators/insert.iterators/front.insert.iterator/types.pass.cpp
@@ -30,6 +30,8 @@
 #include <type_traits>
 #include <vector>
 
+#include "test_macros.h"
+
 template <class C>
 struct find_container
     : private std::front_insert_iterator<C>
@@ -49,7 +51,7 @@
     static_assert((std::is_same<typename R::container_type, C>::value), "");
     static_assert((std::is_same<typename R::value_type, void>::value), "");
     static_assert((std::is_same<typename R::difference_type, void>::value), "");
-    static_assert((std::is_same<typename R::reference, R&>::value), "");
+    LIBCPP_STATIC_ASSERT((std::is_same<typename R::reference, R&>::value), "");
     static_assert((std::is_same<typename R::pointer, void>::value), "");
     static_assert((std::is_same<typename R::iterator_category, std::output_iterator_tag>::value), "");
 }
Index: test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/types.pass.cpp
===================================================================
--- test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/types.pass.cpp
+++ test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/types.pass.cpp
@@ -29,6 +29,8 @@
 #include <type_traits>
 #include <vector>
 
+#include "test_macros.h"
+
 template <class C>
 struct find_container
     : private std::back_insert_iterator<C>
@@ -48,7 +50,7 @@
     static_assert((std::is_same<typename R::container_type, C>::value), "");
     static_assert((std::is_same<typename R::value_type, void>::value), "");
     static_assert((std::is_same<typename R::difference_type, void>::value), "");
-    static_assert((std::is_same<typename R::reference, R&>::value), "");
+    LIBCPP_STATIC_ASSERT((std::is_same<typename R::reference, R&>::value), "");
     static_assert((std::is_same<typename R::pointer, void>::value), "");
     static_assert((std::is_same<typename R::iterator_category, std::output_iterator_tag>::value), "");
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21875.62308.patch
Type: text/x-patch
Size: 3339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160629/4df1f653/attachment.bin>


More information about the cfe-commits mailing list