Merge pull request #16232 from MathiasVP/add-iterator-to-expired-container-fp

C++: Add `cpp/iterator-to-expired-container` FP test
This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-17 09:44:32 +01:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -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 |

View File

@@ -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) {}
}