forked from OSchip/llvm-project
Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
llvm-svn: 273345
This commit is contained in:
parent
c36f0331df
commit
5f15481f87
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue