This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Drop injected class name when class scope is not explicitly specified.
ClosedPublic

Authored by ioeric on Nov 29 2018, 10:04 AM.

Event Timeline

ioeric created this revision.Nov 29 2018, 10:04 AM
kadircet accepted this revision.Nov 30 2018, 1:00 AM

LGTM, thanks!

unittests/clangd/CodeCompleteTests.cpp
419

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.
};
This revision is now accepted and ready to land.Nov 30 2018, 1:00 AM
ioeric marked an inline comment as done.Nov 30 2018, 1:05 AM
ioeric added inline comments.
unittests/clangd/CodeCompleteTests.cpp
419

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!

kadircet added inline comments.Nov 30 2018, 1:12 AM
unittests/clangd/CodeCompleteTests.cpp
419

Ah you are right, it should be rather handled within sema to mark the first one as not accessible.

This revision was automatically updated to reflect the committed changes.