================
@@ -673,9 +674,16 @@ bool SymbolCollector::handleDeclOccurrence(
   // refs, because the indexing code only populates relations for specific
   // occurrences. For example, RelationBaseOf is only populated for the
   // occurrence inside the base-specifier.
-  processRelations(*ND, ID, Relations);
+  processRelations(ID, *ASTNode.OrigD, Relations);
 
   bool CollectRef = static_cast<bool>(Opts.RefFilter & toRefKind(Roles));
+  // For now we only want the bare minimum of information for a class
+  // instantiation such that we have symbols for the `BaseOf` relation.
+  if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D);
+      CTSD && CTSD->hasDefinition() && !CTSD->bases().empty() &&
----------------
HighCommander4 wrote:

The `CTSD->hasDefinition()` and `!CTSD->bases().empty()` conditions here seem 
weird. If a class instantiation doesn't have a definition or doesn't have bases 
then... we do want to `CollectRef` for it?

I think, rather, that checking those conditions in 
`IndexingDeclVisitor::VisitTemplateDecl()` means they won't get here in the 
first place, and the conditions here can be dropped.

Let me know if I'm misunderstanding something.

https://github.com/llvm/llvm-project/pull/177273
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to