Don't pass uninitialized QueryKind

Even if findImplementors does not use
uninitialized parameter it's still UB and
it's going to be detected by msan with:
-Xclang -enable-noundef-analysis -mllvm -msan-eager-checks=1

Differential Revision: https://reviews.llvm.org/D116827
This commit is contained in:
Vitaly Buka 2022-01-07 10:30:50 -08:00
parent ebd8eee62a
commit 244dd2913a
1 changed files with 1 additions and 1 deletions

View File

@ -1298,7 +1298,7 @@ std::vector<LocatedSymbol> findImplementations(ParsedAST &AST, Position Pos,
DeclRelationSet Relations =
DeclRelation::TemplatePattern | DeclRelation::Alias;
llvm::DenseSet<SymbolID> IDs;
RelationKind QueryKind;
RelationKind QueryKind = RelationKind::OverriddenBy;
for (const NamedDecl *ND : getDeclAtPosition(AST, *CurLoc, Relations)) {
if (const auto *CXXMD = llvm::dyn_cast<CXXMethodDecl>(ND)) {
if (CXXMD->isVirtual()) {