[clang-tools-extra] clangd: Extend reference search with constructor calls through forwarding (PR #169742)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 15 00:11:50 PST 2025


HighCommander4 wrote:

I put a print statement in `SymbolCollector::findIndirectConstructors()`, and one in `Sema::InstantiateFunctionDefinition()`, the codepath that creates the instantiation's body based on the primary template's body.

Output when running `FindReferences.ForwardingInIndex`:

> InstantiateFunctionDefinition(make_unique)
> findIndirectConstructors(make_unique)
> findIndirectConstructors(make_unique)

Output when running `BackgroundIndexTest.ConstructorForwarding`:

> findIndirectConstructors(make_unique)
> findIndirectConstructors(make_unique)
> InstantiateFunctionDefinition(make_unique)

So for some reason, during background indexing, the instantiation happens later, and in particular too late for when we'd need it. Very curious.

https://github.com/llvm/llvm-project/pull/169742


More information about the cfe-commits mailing list