fix(cxx_indexer): make logic less tricky and more functional
@@ -4251,12 +4251,12 @@ IndexerASTVisitor::BuildNodeIdForTemplateName(const clang::TemplateName& Name) {
// templates.
if (const auto* FTD = dyn_cast<clang::FunctionTemplateDecl>(
Name.getAsTemplateDecl())) {
- for (const auto* ID = FTD;
- (ID = ID->getInstantiatedFromMemberTemplate()); FTD = ID)
+ while ((FTD = FTD->getInstantiatedFromMemberTemplate())) {
if (FTD->getTemplatedDecl() != nullptr)
decl = FTD->getTemplatedDecl();
}
}
+ }
return BuildNodeIdForDecl(decl);
} else if (const auto* VD = dyn_cast<clang::VarDecl>(UnderlyingDecl)) {
// Direct references to variable templates to the appropriate
