C++: Fix FP and accept test changes.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-05-22 12:34:09 +01:00
parent 91f860ba4f
commit af81698fa8
3 changed files with 2 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ where
outlivesFullExpr(c) and
not c.isFromUninstantiatedTemplate(_) and
isUniquePointerDerefFunction(c.getTarget()) and
not c.getActualType() instanceof BoolType and
isTemporary(c.getQualifier().getFullyConverted())
select c,
"The underlying unique pointer object is destroyed after the call to '" + c.getTarget() +

View File

@@ -9,4 +9,3 @@
| test.cpp:177:16:177:16 | call to operator* | The underlying unique pointer object is destroyed after the call to 'operator*' returns. |
| test.cpp:177:36:177:36 | call to operator* | The underlying unique pointer object is destroyed after the call to 'operator*' returns. |
| test.cpp:179:11:179:11 | call to operator* | The underlying unique pointer object is destroyed after the call to 'operator*' returns. |
| test.cpp:209:29:209:31 | call to get | The underlying unique pointer object is destroyed after the call to 'get' returns. |

View File

@@ -206,7 +206,7 @@ void test2(bool b1, bool b2) {
}
void test_convert_to_bool() {
bool b = get_unique_ptr().get(); // GOOD [FALSE POSITIVE]
bool b = get_unique_ptr().get(); // GOOD
if(get_unique_ptr().get()) { // GOOD