Skip to content

Commit

Permalink
[Clang] use unsigned integer constants in unit-test | fixes build err…
Browse files Browse the repository at this point in the history
…or on ppc64le-lld-multistage-test

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]

Reviewed By: cor3ntin

Differential Revision: https://reviews.llvm.org/D156224
  • Loading branch information
kiloalphaindia authored and cor3ntin committed Jul 25, 2023
1 parent 0d12683 commit d0b54bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/unittests/libclang/LibclangTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ static_assert(true, message);
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) {
Expand All @@ -1229,7 +1229,7 @@ static_assert(true, message);
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:
Expand Down

0 comments on commit d0b54bb

Please sign in to comment.