From dd15ed8a83cb99b10895bf9dc20a7db1c7fe4232 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 23 Jun 2014 18:08:58 +0000 Subject: Cleanup r211507 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211521 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/ScaledNumber.h | 2 ++ unittests/Support/ScaledNumberTest.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/Support/ScaledNumber.h b/include/llvm/Support/ScaledNumber.h index 6a93623a8e..240d5b64aa 100644 --- a/include/llvm/Support/ScaledNumber.h +++ b/include/llvm/Support/ScaledNumber.h @@ -242,6 +242,8 @@ int compareImpl(uint64_t L, uint64_t R, int ScaleDiff); /// for greater than. template int compare(DigitsT LDigits, int16_t LScale, DigitsT RDigits, int16_t RScale) { + static_assert(!std::numeric_limits::is_signed, "expected unsigned"); + // Check for zero. if (!LDigits) return RDigits ? -1 : 0; diff --git a/unittests/Support/ScaledNumberTest.cpp b/unittests/Support/ScaledNumberTest.cpp index f6d7a44754..4a274d7e50 100644 --- a/unittests/Support/ScaledNumberTest.cpp +++ b/unittests/Support/ScaledNumberTest.cpp @@ -285,7 +285,7 @@ TEST(ScaledNumberHelpersTest, getLgCeiling) { EXPECT_EQ(INT32_MIN, getLgCeiling(UINT64_C(0), 1)); } -TEST(ScaledNumberHelpersTest, Compare) { +TEST(ScaledNumberHelpersTest, compare) { EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), 1)); EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), -10)); EXPECT_EQ(0, compare(UINT32_C(0), 0, UINT32_C(0), 20)); -- cgit v1.2.3