This is an archive of the discontinued LLVM Phabricator instance.

[clangd][NFC] Make Located::operator->() use pointer sematics
ClosedPublic

Authored by njames93 on Nov 3 2020, 6:17 AM.

Details

Summary

This enables using the arrow operator to access members of the contained item.

Located<std::string> X;
const char* CStr = X->c_str();

This is inline with how classes like Optional handle the arrow operator.

Diff Detail

Event Timeline

njames93 created this revision.Nov 3 2020, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2020, 6:17 AM
njames93 requested review of this revision.Nov 3 2020, 6:17 AM
kadircet accepted this revision.Nov 3 2020, 12:36 PM

Ah thanks for catching this. LGTM!

This revision is now accepted and ready to land.Nov 3 2020, 12:36 PM
This revision was landed with ongoing or failed builds.Nov 3 2020, 5:36 PM
This revision was automatically updated to reflect the committed changes.