Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -171,8 +171,8 @@ int main()
|
|||||||
// INTN_MIN
|
// INTN_MIN
|
||||||
static_assert(INT8_MIN == -128, "INT8_MIN == -128");
|
static_assert(INT8_MIN == -128, "INT8_MIN == -128");
|
||||||
static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
|
static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
|
||||||
static_assert(INT32_MIN == -2147483648U, "INT32_MIN == -2147483648");
|
static_assert(INT32_MIN == -2147483647 - 1, "INT32_MIN == -2147483648");
|
||||||
static_assert(INT64_MIN == -9223372036854775808ULL, "INT64_MIN == -9223372036854775808LL");
|
static_assert(INT64_MIN == -9223372036854775807LL - 1, "INT64_MIN == -9223372036854775808LL");
|
||||||
|
|
||||||
// INTN_MAX
|
// INTN_MAX
|
||||||
static_assert(INT8_MAX == 127, "INT8_MAX == 127");
|
static_assert(INT8_MAX == 127, "INT8_MAX == 127");
|
||||||
@@ -189,8 +189,8 @@ int main()
|
|||||||
// INT_FASTN_MIN
|
// INT_FASTN_MIN
|
||||||
static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
|
static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
|
||||||
static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
|
static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
|
||||||
static_assert(INT_FAST32_MIN <= -2147483648U, "INT_FAST32_MIN <= -2147483648");
|
static_assert(INT_FAST32_MIN <= -2147483647 - 1, "INT_FAST32_MIN <= -2147483648");
|
||||||
static_assert(INT_FAST64_MIN <= -9223372036854775808ULL, "INT_FAST64_MIN <= -9223372036854775808LL");
|
static_assert(INT_FAST64_MIN <= -9223372036854775807LL - 1, "INT_FAST64_MIN <= -9223372036854775808LL");
|
||||||
|
|
||||||
// INT_FASTN_MAX
|
// INT_FASTN_MAX
|
||||||
static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
|
static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
|
||||||
|
|||||||
@@ -172,8 +172,8 @@ int main()
|
|||||||
// INTN_MIN
|
// INTN_MIN
|
||||||
static_assert(INT8_MIN == -128, "INT8_MIN == -128");
|
static_assert(INT8_MIN == -128, "INT8_MIN == -128");
|
||||||
static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
|
static_assert(INT16_MIN == -32768, "INT16_MIN == -32768");
|
||||||
static_assert(INT32_MIN == -2147483648U, "INT32_MIN == -2147483648");
|
static_assert(INT32_MIN == -2147483647 - 1, "INT32_MIN == -2147483648");
|
||||||
static_assert(INT64_MIN == -9223372036854775808ULL, "INT64_MIN == -9223372036854775808LL");
|
static_assert(INT64_MIN == -9223372036854775807LL - 1, "INT64_MIN == -9223372036854775808LL");
|
||||||
|
|
||||||
// INTN_MAX
|
// INTN_MAX
|
||||||
static_assert(INT8_MAX == 127, "INT8_MAX == 127");
|
static_assert(INT8_MAX == 127, "INT8_MAX == 127");
|
||||||
@@ -190,8 +190,8 @@ int main()
|
|||||||
// INT_FASTN_MIN
|
// INT_FASTN_MIN
|
||||||
static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
|
static_assert(INT_FAST8_MIN <= -128, "INT_FAST8_MIN <= -128");
|
||||||
static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
|
static_assert(INT_FAST16_MIN <= -32768, "INT_FAST16_MIN <= -32768");
|
||||||
static_assert(INT_FAST32_MIN <= -2147483648U, "INT_FAST32_MIN <= -2147483648");
|
static_assert(INT_FAST32_MIN <= -2147483647 - 1, "INT_FAST32_MIN <= -2147483648");
|
||||||
static_assert(INT_FAST64_MIN <= -9223372036854775808ULL, "INT_FAST64_MIN <= -9223372036854775808LL");
|
static_assert(INT_FAST64_MIN <= -9223372036854775807LL - 1, "INT_FAST64_MIN <= -9223372036854775808LL");
|
||||||
|
|
||||||
// INT_FASTN_MAX
|
// INT_FASTN_MAX
|
||||||
static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
|
static_assert(INT_FAST8_MAX >= 127, "INT_FAST8_MAX >= 127");
|
||||||
|
|||||||
Reference in New Issue
Block a user