This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix readability-const-return-type identifying the wrong `const` token
ClosedPublic

Authored by ilya on Dec 18 2019, 9:17 AM.

Details

Summary

Replace tidy::utils::lexer::getConstQualifyingToken with a corrected and also
generalized to other qualifiers variant - getQualifyingToken.

Fixes: http://llvm.org/PR44326

Event Timeline

ilya created this revision.Dec 18 2019, 9:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2019, 9:18 AM
ilya updated this revision to Diff 234560.Dec 18 2019, 9:32 AM

Fix documentation in LexerUtils.h

ilya added a project: Restricted Project.
ilya added a subscriber: ebevhan.
aaron.ballman accepted this revision.Dec 20 2019, 11:11 AM

LGTM with a commenting request.

clang-tools-extra/clang-tidy/utils/LexerUtils.h
95–98

Should we add a comment that this is not for getting a member function qualifier? (I am assuming that case was never intended to work, but if it does work, should we also support ref qualifiers in that case?)

This revision is now accepted and ready to land.Dec 20 2019, 11:11 AM
ilya updated this revision to Diff 235156.Dec 23 2019, 9:26 AM

Update LexerUtils.h documentation.

ilya marked 2 inline comments as done.Dec 23 2019, 9:35 AM

@aaron.ballman, thanks for reviewing. Do you mind submitting this, as I don't have commit access?

clang-tools-extra/clang-tidy/utils/LexerUtils.h
95–98

That's a good point. For the purposes that this function is currently being used, I don't see a reason to support member function qualifiers - updated the documentation accordingly.

ilya updated this revision to Diff 235157.Dec 23 2019, 9:40 AM
ilya marked an inline comment as done.

Doxygen format the documentation.

aaron.ballman closed this revision.Dec 24 2019, 7:11 AM

@aaron.ballman, thanks for reviewing. Do you mind submitting this, as I don't have commit access?

Happy to do so, thank you for the fix! I've commit in f58f39137c6e5a324ef684b1d72bddae244aa94d