mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Add testcase for false positive.
This commit is contained in:
@@ -50,4 +50,5 @@
|
||||
| PointlessComparison.cpp:43:6:43:29 | ... >= ... | Comparison is always true because ... >> ... >= 140737488355327.5. |
|
||||
| PointlessComparison.cpp:44:6:44:28 | ... >= ... | Comparison is always true because ... >> ... >= 140737488355327.5. |
|
||||
| RegressionTests.cpp:57:7:57:22 | ... <= ... | Comparison is always true because * ... <= 4294967295. |
|
||||
| RegressionTests.cpp:125:7:125:11 | ... > ... | Comparison is always false because x <= 0. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
|
||||
@@ -116,3 +116,11 @@ void negativeZero4(int val) {
|
||||
if (val == 0) // GOOD [NO LONGER REPORTED]
|
||||
;
|
||||
}
|
||||
|
||||
void f(int *const &ref_to_ptr);
|
||||
|
||||
void testTempObject() {
|
||||
int x = 0;
|
||||
f(&x);
|
||||
if (x > 0) {} // BAD [FALSE POSITIVE]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user