[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
Tue Dec 16 22:55:03 PST 2025


================
@@ -253,6 +254,23 @@ resolveForwardingParameters(const FunctionDecl *D, unsigned MaxDepth = 10);
 /// reference to one (e.g. `Args&...` or `Args&&...`).
 bool isExpandedFromParameterPack(const ParmVarDecl *D);
 
+/// Heuristic that checks if FT is forwarding a parameter pack to another
+/// function (e.g. `make_unique`).
+bool isLikelyForwardingFunction(FunctionTemplateDecl *FT);
+
+class ForwardingToConstructorVisitor
----------------
HighCommander4 wrote:

Instead of exposing this whole class in `AST.h`, I'd rather we expose a function like `searchForwardingFunctionForConstructors()` (feel free to tweak the name) that takes a `FunctionDecl*` and returns a `vector<CXXConstructorDecl*>`. The class can be an implementation detail of this function.

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


More information about the cfe-commits mailing list