This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Use a reference in a range-based for
ClosedPublic

Authored by Mordante on Nov 9 2019, 9:22 AM.

Details

Summary

Let the checkers use a reference instead of a copy in a range-based for loop.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Diff Detail

Event Timeline

Mordante created this revision.Nov 9 2019, 9:22 AM
aaron.ballman accepted this revision.Nov 11 2019, 5:13 PM

LGTM but the & should bind to the variable, not to the type, so that should be corrected before committing.

This revision is now accepted and ready to land.Nov 11 2019, 5:13 PM
NoQ added a subscriber: NoQ.Nov 11 2019, 5:42 PM

Yay thanks, i always forget those :)

@aaron.ballman good catch, I've fixed it.

This revision was automatically updated to reflect the committed changes.