[PATCH] D53571: [clangd] Don't show base class versions of members as completions.
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 24 06:29:36 PDT 2018
ioeric accepted this revision.
ioeric added a comment.
This revision is now accepted and ready to land.
The diff seems to be wrong. Please rebase.
================
Comment at: clangd/CodeComplete.cpp:732
+ // Class members that are shadowed by subclasses are usually noise.
+ if (Result.Hidden && Result.Declaration &&
+ Result.Declaration->isCXXClassMember())
----------------
sammccall wrote:
> ioeric wrote:
> > Are there hidden results that are neither declarations nor class members and do not require qualifier?
> I don't know. I thought a namespace-scope thing shadowed by a member was such a case, but it doesn't seem to generate results at all.
>
> But that (hypothetical) example illustrates a point: I do think we would want to show ns::foo() if it was shadowed by MyClass()::foo(). The difference is that they're probably fundamentally different things that share a name, while MySubClass::foo() is usually just a strictly better version of MyBaseClass::foo() as far as a caller is concerned.
Fair enough. Thanks!
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D53571
More information about the cfe-commits
mailing list