You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/diagnostics/syserr
Stephan T. Lavavej 4d6f42350e [libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash.
After r289363, these tests were triggering MSVC x64 warning C4267
"conversion from 'size_t' to 'int', possible loss of data" by taking 0, 2, and 10
as std::size_t, then constructing error_code(int, const error_category&) or
error_condition(int, const error_category&) from that (N4618 19.5.3.2
[syserr.errcode.constructors]/3, 19.5.4.2 [syserr.errcondition.constructors]/3).

The fix is simple: take these ints as int, pass them to the int-taking
constructor, and perform a value-preserving static_cast<std::size_t>
when comparing them to `std::size_t result`.

Fixes D27691.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289512 91177308-0d34-0410-b5e6-96231b3b80d8
9 years ago
..
syserr.compare Move test into test/std subdirectory. 11 years ago
syserr.errcat Update errcat.objects tests so they test the bug fixed in r272640. 10 years ago
syserr.errcode Move test into test/std subdirectory. 11 years ago
syserr.errcondition Move test into test/std subdirectory. 11 years ago
syserr.hash [libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash. 9 years ago
syserr.syserr Move test into test/std subdirectory. 11 years ago
errc.pass.cpp Move test into test/std subdirectory. 11 years ago
is_error_code_enum.pass.cpp [libcxx] [test] D27027: Strip trailing whitespace. 9 years ago
is_error_condition_enum.pass.cpp [libcxx] [test] D27027: Strip trailing whitespace. 9 years ago