summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-01-07 21:53:23 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-01-07 21:53:23 +0000
commitd95510ebba10e0d3e2d0adf352dfa5cae87b0756 (patch)
tree4be77b10cb51f633c7b6eb7878e9ce4af59ff0ee /libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
parent601fa8d824de4cc2cbc42c422b25fbdfe3b7dd32 (diff)
downloadbcm5719-llvm-d95510ebba10e0d3e2d0adf352dfa5cae87b0756.tar.gz
bcm5719-llvm-d95510ebba10e0d3e2d0adf352dfa5cae87b0756.zip
libc++ implements its' hash objects as deriving from std::unary_function, and the tests test for that. STL @ MS pointed out that the standard doesn't requie these objects to derive from unary_function, and so the tests should not require that either. Change the tests to check for the embedded typedefs - which ARE required. No change to the library.
llvm-svn: 225403
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp')
-rw-r--r--libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
index b5cd6f8454d..4dbd7b0d810 100644
--- a/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
@@ -33,11 +33,12 @@ template <class T>
void
test()
{
- static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
- std::hash<T> >::value), "");
+ typedef std::hash<T> H;
+ static_assert((std::is_same<H::argument_type, T>::value), "" );
+ static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
typedef typename std::underlying_type<T>::type under_type;
- std::hash<T> h1;
+ H h1;
std::hash<under_type> h2;
for (int i = 0; i <= 5; ++i)
{
OpenPOWER on IntegriCloud