[PATCH] D21872: [libcxx] [test] Fix unary_function inheritance assumption.

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


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

Fix unary_function inheritance assumption.

C++11 didn't require std::hash to derive from std::unary_function. The portable thing to do is to inspect the typedefs, as the other half of this test was already doing.

http://reviews.llvm.org/D21872

Files:
  test/std/containers/sequences/vector.bool/vector_bool.pass.cpp

Index: test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
===================================================================
--- test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -41,8 +41,8 @@
     {
     typedef std::vector<bool, min_allocator<bool>> T;
     typedef std::hash<T> H;
-    static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
-                                   H>::value), "");
+    static_assert((std::is_same<H::argument_type, T>::value), "" );
+    static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
     bool ba[] = {true, false, true, true, false};
     T vb(std::begin(ba), std::end(ba));
     H h;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21872.62304.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160629/34e805aa/attachment.bin>


More information about the cfe-commits mailing list