[clang] [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 22 21:59:24 PST 2025


https://github.com/HighCommander4 requested changes to this pull request.

1. Can we add a background index test that fails without the `ShouldTraverseDecl` change?

2. Here's a case I found that doesn't work: templated constructors:
   ```c++
    #include <memory>

    struct Waldo {
      template <typename T>
      Waldo(T);
    };

    struct S {};

    int main() {
      S s;
      Waldo w(s);  // direct
      std::make_unique<Waldo>(s);  // indirect
    }
    ```

    If you find-refs on the constructor, the direct call is found but the indirect one is not.

    Unlike the case of templated call sites, this one should be fairly easy to make work, so maybe we should do that as part of this patch. (But if you'd rather leave it to a follow-up patch, that's fine with me.)

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


More information about the cfe-commits mailing list