[libcxx] r273345 - Guard libc++ assumption about identity hashing in test. Patch from STL at microsoft.com
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 21 17:53:35 PDT 2016
Author: ericwf
Date: Tue Jun 21 19:53:35 2016
New Revision: 273345
URL: http://llvm.org/viewvc/llvm-project?rev=273345&view=rev
Log:
Guard libc++ assumption about identity hashing in test. Patch from STL at microsoft.com
Modified:
libcxx/trunk/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
Modified: libcxx/trunk/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/unord.hash/integral.pass.cpp?rev=273345&r1=273344&r2=273345&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/unord.hash/integral.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/unord.hash/integral.pass.cpp Tue Jun 21 19:53:35 2016
@@ -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
+ }
}
}
More information about the cfe-commits
mailing list