<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>In the following example, the captured variable `fn` is matched as a TypeLoc of Foo; `fn` outside of the lambda is not matched.</div><div>```</div><div>// test.cc</div><div><div>class Foo {};                              </div><div>  </div><div>template <typename T> struct Fn { T t; };  </div><div><br></div><div>void f(Fn<Foo> &fn) {</div><div>  [&](const Foo &foo) {</div><div>    fn;  // <--------- *** This is matched as a TypeLoc of Foo ***</div><div>  }; </div><div>}</div></div><div>```</div><div><br></div><div>clang-query> m typeLoc(loc(qualType(hasDeclaration(namedDecl(hasName("Foo"))))))</div><div>...</div><div><div>Match #2:</div><div>test.cc:7:5: note: "root" binds here</div><div>    fn;</div><div>    ^~</div></div><div>...</div><div><br></div><div>Is this a bug? If not, is there a way to filter this out? </div><div><br></div><div>Thanks,</div><div>Eric</div><div><br></div></div></div></div></div>