This is an archive of the discontinued LLVM Phabricator instance.

Fix ForRangeCopyCheck not triggering on iterators returning elements by value in C++17.
ClosedPublic

Authored by flx on May 5 2020, 1:10 PM.

Details

Summary

The AST is different in C++17 in that there is no MaterializeTemporaryExpr for in the AST for a loop variable that is initialized from an iterator that returns its elements by value.

Account for this by checking that the variable is not initialized by an operator* call that returns a value type.

Diff Detail

Event Timeline

flx created this revision.May 5 2020, 1:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2020, 1:10 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gribozavr2 accepted this revision.May 5 2020, 11:50 PM
This revision is now accepted and ready to land.May 5 2020, 11:50 PM
This revision was automatically updated to reflect the committed changes.