[PATCH] D156224: [Clang] use unsigned integer constants in unit-test | fixes build error on ppc64le-lld-multistage-test

Kai Stierand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 25 03:38:09 PDT 2023


kiloalphaindia created this revision.
kiloalphaindia added a reviewer: cor3ntin.
Herald added a subscriber: shchenz.
Herald added a project: All.
kiloalphaindia requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fixes:

  /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Wsign-compare]
  /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11: warning: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘const int’ [-Wsign-compare]


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156224

Files:
  clang/unittests/libclang/LibclangTest.cpp


Index: clang/unittests/libclang/LibclangTest.cpp
===================================================================
--- clang/unittests/libclang/LibclangTest.cpp
+++ clang/unittests/libclang/LibclangTest.cpp
@@ -1220,7 +1220,7 @@
   const char *Args[] = {"-xc++", "-std=c++26"};
   ClangTU = clang_parseTranslationUnit(Index, fileName.c_str(), Args,
                                        std::size(Args), nullptr, 0, TUFlags);
-  ASSERT_EQ(clang_getNumDiagnostics(ClangTU), 0);
+  ASSERT_EQ(clang_getNumDiagnostics(ClangTU), 0u);
   std::optional<CXCursor> staticAssertCsr;
   Traverse([&](CXCursor cursor, CXCursor parent) -> CXChildVisitResult {
     if (cursor.kind == CXCursor_StaticAssert) {
@@ -1229,7 +1229,7 @@
     return CXChildVisit_Continue;
   });
   ASSERT_TRUE(staticAssertCsr.has_value());
-  size_t argCnt = 0;
+  int argCnt = 0;
   Traverse(*staticAssertCsr, [&argCnt](CXCursor cursor, CXCursor parent) {
     switch (argCnt) {
     case 0:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156224.543912.patch
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230725/3d6184a8/attachment.bin>


More information about the cfe-commits mailing list