Skip to content

Commit

Permalink
[Support] Fix warnings
Browse files Browse the repository at this point in the history
This patch fixes:

  llvm/unittests/Support/ScopedPrinterTest.cpp:519:20: error: unused
  variable 'InfDouble' [-Werror,-Wunused-variable]

  llvm/unittests/Support/ScopedPrinterTest.cpp:520:16: error: unused
  variable 'NaNDouble' [-Werror,-Wunused-variable]

  llvm/unittests/Support/ScopedPrinterTest.cpp:516:15: error: unused
  variable 'NaNFloat' [-Werror,-Wunused-variable]

  llvm/unittests/Support/ScopedPrinterTest.cpp:515:19: error: unused
  variable 'InfFloat' [-Werror,-Wunused-variable]

Since commit fa56e36 has temporarily
disabled tests involving these constants, this patch simply comments
them out instead of removing them.
  • Loading branch information
kazutakahirata committed Mar 24, 2023
1 parent 4cb0b7c commit 5a9bad1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/unittests/Support/ScopedPrinterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,12 @@ FirstSecondThirdByteMask [ (0x333)
TEST_F(ScopedPrinterTest, PrintNumber) {
constexpr float MaxFloat = std::numeric_limits<float>::max();
constexpr float MinFloat = std::numeric_limits<float>::min();
constexpr float InfFloat = std::numeric_limits<float>::infinity();
const float NaNFloat = std::nanf("1");
// constexpr float InfFloat = std::numeric_limits<float>::infinity();
// const float NaNFloat = std::nanf("1");
constexpr double MaxDouble = std::numeric_limits<double>::max();
constexpr double MinDouble = std::numeric_limits<double>::min();
constexpr double InfDouble = std::numeric_limits<double>::infinity();
const double NaNDouble = std::nan("1");
// constexpr double InfDouble = std::numeric_limits<double>::infinity();
// const double NaNDouble = std::nan("1");

auto PrintFunc = [&](ScopedPrinter &W) {
uint64_t Unsigned64Max = std::numeric_limits<uint64_t>::max();
Expand Down

0 comments on commit 5a9bad1

Please sign in to comment.