[PATCH] D53571: [clangd] Don't show base class versions of members as completions.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 06:15:39 PDT 2018


sammccall added a comment.

In https://reviews.llvm.org/D53571#1274082, @ioeric wrote:

> > Keep required quailifier machinery around though, for cross-ns completion.
>
> Do we have cross-ns completion in sema?


No, I don't think so. I meant RequiredQualifier etc.
Unfortunately I've got no idea whether there are !QualifierIsInformative cases in Sema we still care about, so I don't know whether that logic is safe to remove...



================
Comment at: clangd/CodeComplete.cpp:732
+      // Class members that are shadowed by subclasses are usually noise.
+      if (Result.Hidden && Result.Declaration &&
+          Result.Declaration->isCXXClassMember())
----------------
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.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53571





More information about the cfe-commits mailing list