mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Add 'cpp/use-of-unique-pointer-after-lifetime-ends' FP.
This commit is contained in:
@@ -9,3 +9,4 @@
|
||||
| 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. |
|
||||
|
||||
@@ -203,4 +203,12 @@ void test2(bool b1, bool b2) {
|
||||
auto s11 = b2 ? nullptr : sRefRef.get(); // GOOD
|
||||
const S* s12;
|
||||
s12 = sRefRef.get(); // GOOD
|
||||
}
|
||||
|
||||
void test_convert_to_bool() {
|
||||
bool b = get_unique_ptr().get(); // GOOD [FALSE POSITIVE]
|
||||
|
||||
if(get_unique_ptr().get()) { // GOOD
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user