[PATCH] D70445: [clangd] Show lambda signature for lambda autocompletions
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 23:46:27 PST 2019
kbobyrev added inline comments.
================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:3398
+ // parameters.
+ auto AddTemplatedFunctionTypeAndResult = [&](const FunctionTemplateDecl
+ *FunTmpl) {
----------------
sammccall wrote:
> I actually think there's no need to modify the "templated function" path at all - you can just take return the templated FunctionDecl from `extractFunctorCallOperator` and treat it as a regular function.
>
> The template function stuff is about identifying template parameters that need to be spelled, and adding them to the CCS. With generic lambdas the type parameters are always deduced and may not be specified. And this can be assumed the case for general functors as well, as the syntax `Functor f; f<int>();` isn't legal.
Good point! I did that because, as I mentioned earlier, my impression was that we would probably want something like `foo<class A, class B>(A a, const B &b) -> B *` (and probably even more complicated things to print dependent types). But if we don't want to go that direction, this should not be needed, thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70445/new/
https://reviews.llvm.org/D70445
More information about the cfe-commits
mailing list