[clang] ee15e2b - [clang] Silence warning when building with MSVC targetting x86

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 06:34:28 PST 2024


Author: Alexandre Ganea
Date: 2024-01-25T09:34:17-05:00
New Revision: ee15e2bd32a4677c40d927c732b26d33f88d7865

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

LOG: [clang] Silence warning when building with MSVC targetting x86

This fixes:
```
[3786/6996] Building CXX object tools\clang\lib\AST\CMakeFiles\obj.clangAST.dir\AttrDocTable.cpp.obj
C:\git\llvm-project\clang\lib\AST\AttrDocTable.cpp(24): warning C4018: '<': signed/unsigned mismatch
```

Added: 
    

Modified: 
    clang/lib/AST/AttrDocTable.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/AttrDocTable.cpp b/clang/lib/AST/AttrDocTable.cpp
index df7e3d63a6c355a..56a143b9ed29be6 100644
--- a/clang/lib/AST/AttrDocTable.cpp
+++ b/clang/lib/AST/AttrDocTable.cpp
@@ -21,7 +21,7 @@ static const llvm::StringRef AttrDoc[] = {
 };
 
 llvm::StringRef clang::Attr::getDocumentation(clang::attr::Kind K) {
-  if (K < std::size(AttrDoc))
+  if (K < (int)std::size(AttrDoc))
     return AttrDoc[K];
   return "";
 }


        


More information about the cfe-commits mailing list