<div dir="auto"><div>AST dump doesn't traverse into typelocs, which is where x is.</div><div dir="auto"><br></div><div dir="auto">That said, this particular case is not worth any complexity at all. Even pointer-to-lambda is vanishingly rare.</div><div dir="auto"><br></div><div dir="auto">Regarding dropping ref/pointer info: one option here is keeping the old "class (lambda)&", and simply making sure we now populate return/params. I'm not sure setting Type as if it were a function is actually clarifying.</div><div dir="auto"><br></div><div dir="auto">If you don't want to do this, I'd suggest not unwrapping pointers, and living with the lost ref qualifiers (only realistic case i can think of where it matters is a by-ref capture of a lambda inside another lambda, and i don't think anyone will notice if we pretend it's a value)</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2019, 16:11 Kadir Cetinkaya via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">kadircet added inline comments.<br>
<br>
<br>
================<br>
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:831<br>
+         };<br>
          return HI;<br>
        }},<br>
----------------<br>
ilya-biryukov wrote:<br>
> kadircet wrote:<br>
> > ilya-biryukov wrote:<br>
> > > Could you add another test with even weirder types where we fail to show the signature? To make sure we don't break when reaching the limitations of the chosen approach and document what those limitations are.<br>
> > > <br>
> > > Something like:<br>
> > > ```<br>
> > > auto a = [](int a) { return 10; };<br>
> > > auto *b = &a;<br>
> > > auto *c = &b;<br>
> > > ```<br>
> > > <br>
> > > We would fail to show the signature here, but it's totally ok to ignore it.<br>
> > added cases, and changed code(a lot simpler now) to generate signatures for those cases as well.<br>
> Here's an example when the new approach falls short too:<br>
> <br>
> ```<br>
> auto a = [](int) { return 10; }<br>
> std::function<void(decltype(a) x)> b;<br>
> ```<br>
> <br>
> In general, are we ok with loosing all the information about the type that we drop?<br>
> One level of references and pointers seemed ok, dropping more is a bit more cheesy..<br>
> <br>
> At the same time, either case is **so** rare that we probably don't care.<br>
are you talking about hovering over `x` ? I don't think AST contains information regarding that one. <br>
<br>
for a code like this:<br>
```<br>
auto foo = []() { return 5; };<br>
<br>
template <class T><br>
class Cls {};<br>
<br>
Cls<void(decltype(foo) bar)> X;<br>
```<br>
<br>
This is the AST dump for variable X:<br>
```<br>
`-VarDecl 0x2b0e808 <line:6:1, col:30> col:30 X 'Cls<void (decltype(foo))>':'Cls<void ((lambda at a.cc:1:12))>' callinit<br>
  `-CXXConstructExpr 0x2b12e80 <col:30> 'Cls<void (decltype(foo))>':'Cls<void ((lambda at a.cc:1:12))>' 'void () noexcept'<br>
```<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D62814/new/" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D62814/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D62814" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D62814</a><br>
<br>
<br>
<br>
</blockquote></div></div></div>