Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-06-22 00:53:35 +00:00
parent 571d549ddd
commit 62957fb722

View File

@@ -16,14 +16,14 @@
// size_t operator()(T val) const;
// };
// Not very portable
#include <functional>
#include <cassert>
#include <type_traits>
#include <cstddef>
#include <limits>
#include "test_macros.h"
template <class T>
void
test()
@@ -37,7 +37,11 @@ test()
{
T t(i);
if (sizeof(T) <= sizeof(std::size_t))
assert(h(t) == t);
{
const std::size_t result = h(t);
LIBCPP_ASSERT(result == t);
((void)result); // Prevent unused warning
}
}
}