[PATCH] D55065: [clangd] Drop injected class name when class scope is not explicitly specified.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 30 01:13:13 PST 2018


kadircet added inline comments.


================
Comment at: unittests/clangd/CodeCompleteTests.cpp:419
 
+TEST(CompletionTest, SkipInjectedWhenUnqualified) {
+  EXPECT_THAT(completions("struct X { void f() { X^ }};").Completions,
----------------
ioeric wrote:
> kadircet wrote:
> > Could you also add a test for the inheritance of injected class name? For ex:
> > 
> > ```
> > struct X {};
> > struct T : private X {};
> > struct F : public T {
> > X^ <-- this is inavlid and we should not suggest X here, since it is inaccessible.
> > ::X^ <-- this should be Ok.
> > };
> > ```
> Happy to improve the test coverage. But I couldn't see how this tests changes in this patch. It seems something sema access should be testing and a bit out of scope? Could you elaborate on the intention? Thanks!
Ah you are right, it should be rather handled within sema to mark the first one as not accessible.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55065/new/

https://reviews.llvm.org/D55065





More information about the cfe-commits mailing list