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

C++: Add `cpp/iterator-to-expired-container` FP
This commit is contained in:
Mathias Vorreiter Pedersen
2024-05-07 09:10:38 +01:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -4,3 +4,4 @@
| test.cpp:702:27:702:27 | call to operator[] | This object is destroyed at the end of the full-expression. |
| test.cpp:727:23:727:23 | call to operator[] | This object is destroyed at the end of the full-expression. |
| test.cpp:735:23:735:23 | call to operator[] | This object is destroyed at the end of the full-expression. |
| test.cpp:803:3:803:3 | pointer to ~vector output argument | This object is destroyed at the end of the full-expression. |

View File

@@ -792,4 +792,13 @@ void test4() {
// function we may end up in the destructor call `chunk.~A()`in `A.foo`. This destructor
// call can flow to `begin` through the back-edge and cause a strange FP.
auto zero = A().size();
}
void test5(int i)
{
while(i < 10) {
const auto& vvs = returnValue();
for(const auto& vs : vvs) { }
++i;
} // GOOD [FALSE POSITIVE]
}