Existing version ignores symbols declared in an inline namespace ns
when removing using namespace ns
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp | ||
---|---|---|
212 | We can replace printUsingNamespaceName with printNamespaceScope here so that we can get a::foobar() in the test. However, it can sometimes cause redundancy such as in the 10th test. And I don't know whether it is worth it. WDYT? |
clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp | ||
---|---|---|
212 | Just making sure I understood this correctly: If you replace printUsingNamespaceName with printNamespaceScope, then...
namespace a::b { struct Foo {}; } using namespace a; using namespace a::[[b]]; using namespace b; int main() { Foo F;} what would be the result..? would you get a::Foo instead of a::b::Foo? |
clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp | ||
---|---|---|
212 | Sorry, I mean the next test. I read 10 from the inlay hint but I forgot the index starts from 0 :( The test I want to mention: namespace a::b { struct Foo {}; } using namespace a; using namespace a::b; using namespace [[b]]; int main() { Foo F;} We will get a::b::Foo in both the 10th and 11th tests. So in the 10th test, we don't get any benefits and don't sacrifice anything. In the 11th test, we get more redundancy than the existing version. Apologize again for my mistake. |
Sorry! I thought you’d probably first wanted to address the remaining comments in https://reviews.llvm.org/D137817 because they might also affect this patch here..?
Oops! Thank you for your thoughtful consideration.
You're right, but I currently get stuck there and need more time. And I prefer to clear the existing patches simultaneously if you don't mind.
Or do you think I should merge the modification of this patch into there and give up this?
clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp | ||
---|---|---|
212 | FYI, we have a discussion left here. |