[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-23 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. In D134379#3808043 , @kadircet wrote: > In D134379#3807770 , @ArcsinX wrote: > >> Anyway if this is the only concern, we can handle namespace declaration as a >> special case inside

[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D134379#3807770 , @ArcsinX wrote: > Anyway if this is the only concern, we can handle namespace declaration as a > special case inside `ReferencedLocationCrawler::add()`. something like this: > > diff > -for (const

[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-22 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. Anyway if this is the only concern, we can handle namespace declaration as a special case inside `ReferencedLocationCrawler::add()`. something like this: diff -for (const Decl *Redecl : D->redecls()) - Result.User.insert(Redecl->getLocation()); +if

[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-21 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. In D134379#3806664 , @sammccall wrote: > Is test.h meaningfully used in that example? > Yes, the code is going to fail to compile without it, but it seems like the > "spirit" of IWYU would say to delete both the include and the

[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-21 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Is test.h meaningfully used in that example? Yes, the code is going to fail to compile without it, but it seems like the "spirit" of IWYU would say to delete both the include and the using directive. My concern about marking it used is that namespaces are typically

[PATCH] D134379: [clangd] IncludeCleaner: handle using namespace

2022-09-21 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX created this revision. ArcsinX added reviewers: sammccall, kbobyrev. Herald added subscribers: kadircet, arphaman. Herald added a project: All. ArcsinX requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: