[llvm] 5a9bad1 - [Support] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 13:02:03 PDT 2023


Author: Kazu Hirata
Date: 2023-03-24T13:01:52-07:00
New Revision: 5a9bad171be5dfdf9430a0f6cbff14d29ca54181

URL: https://github.com/llvm/llvm-project/commit/5a9bad171be5dfdf9430a0f6cbff14d29ca54181
DIFF: https://github.com/llvm/llvm-project/commit/5a9bad171be5dfdf9430a0f6cbff14d29ca54181.diff

LOG: [Support] Fix warnings

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 fa56e362af475e0758cfb41c42f78db50da7235c has temporarily
disabled tests involving these constants, this patch simply comments
them out instead of removing them.

Added: 
    

Modified: 
    llvm/unittests/Support/ScopedPrinterTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/ScopedPrinterTest.cpp b/llvm/unittests/Support/ScopedPrinterTest.cpp
index 48600cd057506..1b2d03bedaaa6 100644
--- a/llvm/unittests/Support/ScopedPrinterTest.cpp
+++ b/llvm/unittests/Support/ScopedPrinterTest.cpp
@@ -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();


        


More information about the llvm-commits mailing list