https://github.com/HighCommander4 approved this pull request.

Thanks, the change looks good to me!

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):

```c++
namespace NS {
void unrelated();
void foo();
}

auto L = [] {
  using NS::unrelated;
  NS::foo();
};
```

Here, if the "add using-declaration" code action is invoked on `NS::foo`, 
before this patch the result is:

```c++
namespace NS {
void unrelated();
void foo();
}

using NS::foo;

auto L = [] {
  using NS::unrelated;
  foo();
};
```

but after this patch the result is:

```c++
namespace NS {
void unrelated();
void foo();
}

auto L = [] {
  using NS::foo;
  using NS::unrelated;
  foo();
};
```

Let's add this test case to `AddUsingTests` while we're at it.

https://github.com/llvm/llvm-project/pull/76329
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to