This is an archive of the discontinued LLVM Phabricator instance.

readability-const-return-type: don't diagnose a template function returning T, even if sometimes instantiated with e.g. T = const int.
ClosedPublic

Authored by suertreus on Dec 20 2022, 2:42 PM.

Details

Summary

It's not really a readability problem since there's no const to read at the declaration site, and returning std::remove_const_t<T> instead usually only hurts readability.

Diff Detail

Event Timeline

suertreus created this revision.Dec 20 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald Transcript
suertreus requested review of this revision.Dec 20 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 2:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ymandel accepted this revision.Dec 27 2022, 12:23 PM

Thanks!

This revision is now accepted and ready to land.Dec 27 2022, 12:23 PM

Thanks for reviewing.

I don't have commit access; can someone who does please do the thing?

Sure, please ping me if you don't see a commit by EOD

Thanks for reviewing.

I don't have commit access; can someone who does please do the thing?

@suertreus I can help you land the patch, what user name and email should I use for attribution?

Thanks for reviewing.

I don't have commit access; can someone who does please do the thing?

@suertreus I can help you land the patch, what user name and email should I use for attribution?

Sorry for the delay -- I'm doing the commit now (just running tests first)

Andy Getzendanner <durandal@google.com> please, and thanks!

Thanks for reviewing.

I don't have commit access; can someone who does please do the thing?

@suertreus I can help you land the patch, what user name and email should I use for attribution?

Sorry for the delay -- I'm doing the commit now (just running tests first)

Sounds good, I'll leave you to it :) Let me know otherwise if you need help!