This is an archive of the discontinued LLVM Phabricator instance.

Fix "use after move" in iterator_range
ClosedPublic

Authored by andrew.w.kaylor on Aug 8 2023, 4:19 PM.

Details

Summary

A static analysis tool reported a "use after move" error in a place where the same object was being passed to two different calls using std::forward. While this seems unlikely to present an actual problem, removing the std::forward makes the code slightly more robust.

This is an update to D152891.

Diff Detail

Event Timeline

andrew.w.kaylor created this revision.Aug 8 2023, 4:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 4:19 PM
andrew.w.kaylor requested review of this revision.Aug 8 2023, 4:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 4:19 PM
steakhal accepted this revision.Aug 8 2023, 10:18 PM

Please have a link to the inline discussion where you originally raised this.
Also, make sure everything still complies and monitor if you need to revert once you merged the change.

This revision is now accepted and ready to land.Aug 8 2023, 10:18 PM
This revision was automatically updated to reflect the committed changes.