kadircet added inline comments.
================ Comment at: clang-tools-extra/clangd/AST.cpp:110 + +static bool isAnonymous(const DeclarationName &N) { + return N.isIdentifier() && !N.getAsIdentifierInfo(); ---------------- could you move this one back above `getQualifierLoc` ? ================ Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional<ReferenceLoc> refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor<Visitor> { ---------------- ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > This should return `SmallVector<ReferenceLoc, 2>` now, some declarations > > > can have both decl and non-decl references. > > Can you give some examples? It seems that non-decl references are handled > > by other `refIn*` functions. > > > > ``` > > int Foo = OtherBar; // OtherBar is captured at the momment. > > ``` > ``` > namespace $1[[a]] = $2[[std]]; > ``` > > `$1` is a declaration of a namespace alias. > `$2` is a reference to namespace std. I was just about to make the same point. After this patch lands I would like to detect `using namespace`s inside function body, and currently there is no way to distinguish between a usingdirective and a namespacealias. Since both is only referencing the target namespace. So even if this starts reporting `$2` in the comment above, there should be a difference between that and `$3` in `using namespace $3[[std]];` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits