This is an archive of the discontinued LLVM Phabricator instance.

[CodeComplete] Complete members of dependent `auto` variables
ClosedPublic

Authored by sammccall on Dec 14 2022, 11:53 AM.

Details

Summary

When the initializer of an auto variable is dependent, clang doesn't give the
DeclRefExpr a useful dependent type that we can apply heuristics to.
However we can dig one up by looking at the initializer.

Diff Detail

Event Timeline

sammccall created this revision.Dec 14 2022, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 11:53 AM
sammccall requested review of this revision.Dec 14 2022, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 11:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
hokein accepted this revision.Dec 15 2022, 12:07 AM
hokein added inline comments.
clang/test/CodeCompletion/member-access.cpp
121

It feels horrible that we have to update all following line numbers whenever we add a new test, no action required here (we can always append a new test, but then tests are not grouped properly)

This revision is now accepted and ready to land.Dec 15 2022, 12:07 AM
ilya-biryukov added inline comments.
clang/test/CodeCompletion/member-access.cpp
121

+1, I would also love to a syntax like $L-5 or {{L-5}} for this in FileCheck. Something short and easy to read.

This revision was landed with ongoing or failed builds.Dec 15 2022, 7:10 AM
This revision was automatically updated to reflect the committed changes.