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

llvm-svn: 273345
This commit is contained in:
Eric Fiselier 2016-06-22 00:53:35 +00:00
parent c36f0331df
commit 5f15481f87
1 changed files with 7 additions and 3 deletions

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
}
}
}