File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
cpp/ql/test/query-tests/Likely Bugs/Arithmetic/PointlessComparison Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 5050| PointlessComparison.cpp:43:6:43:29 | ... >= ... | Comparison is always true because ... >> ... >= 140737488355327.5. |
5151| PointlessComparison.cpp:44:6:44:28 | ... >= ... | Comparison is always true because ... >> ... >= 140737488355327.5. |
5252| RegressionTests.cpp:57:7:57:22 | ... <= ... | Comparison is always true because * ... <= 4294967295. |
53+ | RegressionTests.cpp:125:7:125:11 | ... > ... | Comparison is always false because x <= 0. |
5354| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
Original file line number Diff line number Diff line change @@ -116,3 +116,11 @@ void negativeZero4(int val) {
116116 if (val == 0 ) // GOOD [NO LONGER REPORTED]
117117 ;
118118}
119+
120+ void f (int *const &ref_to_ptr);
121+
122+ void testTempObject () {
123+ int x = 0 ;
124+ f (&x);
125+ if (x > 0 ) {} // BAD [FALSE POSITIVE]
126+ }
You can’t perform that action at this time.
0 commit comments