[clang-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 21:57:13 PST 2024


zyn0217 wrote:

Sorry for being silent for a few days, I've been a bit occupied recently and hopefully I could get back to the heuristic patch for templates soon.

> I went through the existing callers of Node::getDeclContext(), and I was able to construct a test case where the patch actually changes behaviour (in a good way):

Thank you for the exploration! I've added the test case, although it appears a bit odd:
```cpp
auto L = [] {
  using NS::foo;using NS::unrelated; // Shouldn't it be placed on a new line?
  foo();
};)cpp
```

However, I've seen a similar tweaking style (e.g. `namespace {using one::two::ff;`) around these tests, so maybe this is intended?


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


More information about the cfe-commits mailing list