[PATCH] D141800: [clangd] Fix qualifier not being dropped for using declaration referring to scoped enum

Tom Praschan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 15 10:54:38 PST 2023


tom-anders created this revision.
tom-anders added reviewers: nridge, kadircet.
Herald added a subscriber: arphaman.
Herald added a project: All.
tom-anders requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Relevant issue: https://github.com/clangd/clangd/issues/1361

The problem here was that writing something like `using ns::ScopedEnum`
does not cause Sema to visit this scope, to it won't be added into
`CodeCompletionBuilder`'s `AccessibleScopes`, leading to the qualifier not
being dropped.

To detect this, walk up the DeclContext to check if we have a matching
using declaration. If so, drop the qualifiers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141800

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141800.489378.patch
Type: text/x-patch
Size: 4759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230115/6caa0dda/attachment.bin>


More information about the cfe-commits mailing list