[llvm] 8dd77fa - [Support] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 12:57:17 PST 2023


Author: Kazu Hirata
Date: 2023-12-19T12:57:08-08:00
New Revision: 8dd77fa5ae2c20cce903501e9090c663bf97d144

URL: https://github.com/llvm/llvm-project/commit/8dd77fa5ae2c20cce903501e9090c663bf97d144
DIFF: https://github.com/llvm/llvm-project/commit/8dd77fa5ae2c20cce903501e9090c663bf97d144.diff

LOG: [Support] Fix warnings

This patch fixes:

  third-party/unittest/googletest/include/gtest/gtest.h:1379:11:
  error: comparison of integers of different signs: 'const int' and
  'const unsigned int' [-Werror,-Wsign-compare]

  llvm/unittests/Support/CommandLineTest.cpp:2294:3: note: in
  instantiation of function template specialization
  'testing::internal::EqHelper::Compare<int, unsigned int, nullptr>'
  requested here

Added: 
    

Modified: 
    llvm/unittests/Support/CommandLineTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 328674a9e67dff..a9d0790c8fea22 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -2291,10 +2291,10 @@ TEST(CommandLineTest, SubCommandGroups) {
   // The "--opt12" option is expected to be added to both subcommands in the
   // group, but not to the top-level "no subcommand" pseudo-subcommand or the
   // "sc3" subcommand.
-  EXPECT_EQ(1, SC1.OptionsMap.size());
+  EXPECT_EQ(1U, SC1.OptionsMap.size());
   EXPECT_TRUE(SC1.OptionsMap.contains("opt12"));
 
-  EXPECT_EQ(1, SC2.OptionsMap.size());
+  EXPECT_EQ(1U, SC2.OptionsMap.size());
   EXPECT_TRUE(SC2.OptionsMap.contains("opt12"));
 
   EXPECT_FALSE(cl::SubCommand::getTopLevel().OptionsMap.contains("opt12"));


        


More information about the llvm-commits mailing list