[clang] b8388fa - [clang][NFC] Fix warning of integer comparison

Kai Luo via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 23:13:45 PDT 2022


Author: Kai Luo
Date: 2022-03-24T14:06:45+08:00
New Revision: b8388fa319bc68bee396a14857331fb2e7b815bd

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

LOG: [clang][NFC] Fix warning of integer comparison

```
warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare]
```

Fix https://lab.llvm.org/buildbot/#/builders/57/builds/16220.

Added: 
    

Modified: 
    clang/unittests/AST/DeclTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/AST/DeclTest.cpp b/clang/unittests/AST/DeclTest.cpp
index bf2826c7b329f..7c227d40af86b 100644
--- a/clang/unittests/AST/DeclTest.cpp
+++ b/clang/unittests/AST/DeclTest.cpp
@@ -188,7 +188,7 @@ TEST(Decl, InConsistLinkageForTemplates) {
   llvm::SmallVector<ast_matchers::BoundNodes, 2> Funcs =
       match(functionDecl().bind("f"), Ctx);
 
-  EXPECT_EQ(Funcs.size(), 2);
+  EXPECT_EQ(Funcs.size(), 2U);
   const FunctionDecl *TemplateF = Funcs[0].getNodeAs<FunctionDecl>("f");
   const FunctionDecl *SpecializedF = Funcs[1].getNodeAs<FunctionDecl>("f");
   EXPECT_EQ(TemplateF->getLinkageInternal(),


        


More information about the cfe-commits mailing list