[Clang] Silence warning when building with MSVC 2022

Previously, the warning seen:

[22/95] Building CXX object tools\clang\lib\StaticAnalyzer\Checker...bj.clangStaticAnalyzerCheckers.dir\NoReturnFunctionChecker.cpp.objC:\git\llvm-project\clang\lib\StaticAnalyzer\Checkers\NoReturnFunctionChecker.cpp(149): warning C4305: 'if': truncation from 'size_t' to 'bool'
C:\git\llvm-project\clang\include\clang/Analysis/SelectorExtras.h(28): note: see reference to function template instantiation 'clang::Selector clang::getKeywordSelector<const char,const char,const char,const char>(clang::ASTContext &,const char *,const char *,const char *,const char *)' being compiled
C:\git\llvm-project\clang\lib\StaticAnalyzer\Checkers\NoReturnFunctionChecker.cpp(125): note: see reference to function template instantiation 'void clang::lazyInitKeywordSelector<const char,const char,const char,const char>(clang::Selector &,clang::ASTContext &,const char *,const char *,const char *,const char *)' being compiled
This commit is contained in:
Alexandre Ganea 2022-07-05 12:40:22 -04:00
parent db3013d684
commit 18f230a89a
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ namespace clang {
template <typename... IdentifierInfos>
static inline Selector getKeywordSelector(ASTContext &Ctx,
IdentifierInfos *... IIs) {
static_assert(sizeof...(IdentifierInfos),
static_assert(sizeof...(IdentifierInfos) > 0,
"keyword selectors must have at least one argument");
SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});