Skip to content

Commit

Permalink
Merge pull request #16232 from MathiasVP/add-iterator-to-expired-cont…
Browse files Browse the repository at this point in the history
…ainer-fp

C++: Add `cpp/iterator-to-expired-container` FP test
  • Loading branch information
MathiasVP authored Apr 17, 2024
2 parents f78ea26 + 62299dc commit b201fd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
| test.cpp:727:23:727:23 | call to operator[] | This object is destroyed before $@ is called. | test.cpp:750:17:750:17 | call to end | call to end |
| test.cpp:735:23:735:23 | call to operator[] | This object is destroyed before $@ is called. | test.cpp:759:17:759:17 | call to begin | call to begin |
| test.cpp:735:23:735:23 | call to operator[] | This object is destroyed before $@ is called. | test.cpp:759:17:759:17 | call to end | call to end |
| test.cpp:771:44:771:56 | temporary object | This object is destroyed before $@ is called. | test.cpp:772:35:772:35 | call to begin | call to begin |
| test.cpp:771:44:771:56 | temporary object | This object is destroyed before $@ is called. | test.cpp:772:35:772:35 | call to end | call to end |
Original file line number Diff line number Diff line change
Expand Up @@ -766,3 +766,8 @@ void test2() {
for (auto x : value) {}
}
}

void test3() {
const std::vector<std::vector<int>>& v = returnValue(); // GOOD [FALSE POSITIVE]
for(const std::vector<int>& x : v) {}
}

0 comments on commit b201fd0

Please sign in to comment.