diff options
Diffstat (limited to 'test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp')
-rw-r--r-- | test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp index b812e364bbc5..c8b3d98103c4 100644 --- a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp +++ b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp @@ -16,12 +16,12 @@ // size_t operator()(T val) const; // }; -// Not very portable - #include <system_error> #include <cassert> #include <type_traits> +#include "test_macros.h" + void test(int i) { @@ -31,7 +31,9 @@ test(int i) static_assert((std::is_same<H::result_type, std::size_t>::value), "" ); H h; T ec(i, std::system_category()); - assert(h(ec) == i); + const std::size_t result = h(ec); + LIBCPP_ASSERT(result == i); + ((void)result); // Prevent unused warning } int main() |