summaryrefslogtreecommitdiff
path: root/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/function.objects/unord.hash/enum.pass.cpp')
-rw-r--r--test/std/utilities/function.objects/unord.hash/enum.pass.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
index af367789a105b..a7ddd9a499977 100644
--- a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
@@ -36,6 +36,7 @@ test()
typedef std::hash<T> H;
static_assert((std::is_same<typename H::argument_type, T>::value), "" );
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
+ ASSERT_NOEXCEPT(H()(T()));
typedef typename std::underlying_type<T>::type under_type;
H h1;
@@ -43,7 +44,8 @@ test()
for (int i = 0; i <= 5; ++i)
{
T t(static_cast<T> (i));
- if (sizeof(T) <= sizeof(std::size_t))
+ const bool small = std::integral_constant<bool, sizeof(T) <= sizeof(std::size_t)>::value; // avoid compiler warnings
+ if (small)
assert(h1(t) == h2(static_cast<under_type>(i)));
}
}