[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

UTKARSH SAXENA via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 02:55:05 PDT 2019


usaxena95 added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:139
+  SourceLocation FirstUsingDirectiveLoc =
+      SM.getLocForEndOfFile(SM.getMainFileID());
+  for (auto *D : AllDirectives) {
----------------
ilya-biryukov wrote:
> I'm not 100% certain this is considered to be the end location, as there macros, etc.
> Could we instead start with an invalid source location
Replaced it with uninitialized (which is invalid) SourceLocation. Makes it simpler. 


================
Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:810
+      using namespace a::[[b]];
+      using namespace b;
+      int main() { Foo F;}
----------------
ilya-biryukov wrote:
> What happens if we remove this one?
> Will it still qualify as `a::b` or as `b::`?
> 
> Could we add a test just to document the behavior?
It qualifies as `b::`. Added a test for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68562/new/

https://reviews.llvm.org/D68562





More information about the cfe-commits mailing list