This is an archive of the discontinued LLVM Phabricator instance.

[clang][CodeComplete] Perform approximate member search in bases
ClosedPublic

Authored by kadircet on Jan 11 2022, 9:56 AM.

Diff Detail

Unit TestsFailed

Event Timeline

kadircet created this revision.Jan 11 2022, 9:56 AM
kadircet requested review of this revision.Jan 11 2022, 9:56 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 11 2022, 9:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sammccall accepted this revision.Jan 11 2022, 10:09 AM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
3456 ↗(On Diff #398996)

"undeducedtype" seems like a strange name for this test - MemberFromBaseOfDependent?

3456 ↗(On Diff #398996)

you might want this test in clang/test/CodeCompletion as well/instead.

3459 ↗(On Diff #398996)

does this also work if the base is dependent (Base<T>)?

clang/lib/Sema/SemaCodeComplete.cpp
5416–5422

could be a little more precise: "look up member heuristically, including in bases"

5425

This case seems very nearly dead. Technically it is possible to get a CXXDependentScopeMemberExpr in C using recovery expr, but I can't find a case where this is useful. Maybe drop it?

This revision is now accepted and ready to land.Jan 11 2022, 10:09 AM
kadircet updated this revision to Diff 399252.Jan 12 2022, 1:36 AM
kadircet marked 5 inline comments as done.
  • Replace clangd unittest with clang lit
  • get rid of non-cxxrecorddecl handling
kadircet added inline comments.Jan 12 2022, 1:37 AM
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
3459 ↗(On Diff #398996)

yes

clang/lib/Sema/SemaCodeComplete.cpp
5425

ah right, i was mostly concerned about objc records, forgetting that we only perform this in dependent contexts :D

This revision was landed with ongoing or failed builds.Jan 12 2022, 1:57 AM
This revision was automatically updated to reflect the committed changes.