File tree Expand file tree Collapse file tree
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/AssignWhereCompareMeant Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ void f2() {
126126}
127127
128128void f3 (int x, int y) {
129- if (x == 1 && (y = 2 )) { // GOOD [FALSE POSITIVE] : the programmer seems to be okay with unparenthesized
129+ if (x == 1 && (y = 2 )) { // GOOD: the programmer seems to be okay with unparenthesized
130130 // comparison operands, so the parenthesis was used to mark this
131131 // as an assignment
132132 }
@@ -138,13 +138,13 @@ void f3(int x, int y) {
138138 if (((z == 42 ) || (y = 2 )) && (x == 1 )) { // BAD
139139 }
140140
141- if ((y = 2 ) && (x == z || x == 1 )) { // GOOD [FALSE POSITIVE]
141+ if ((y = 2 ) && (x == z || x == 1 )) { // GOOD
142142 }
143143
144144 if (((x == 42 ) || x == 1 ) && (y = 2 )) { // BAD
145145 }
146146
147- if (x == 10 || (x == 42 && x == 1 ) && (y = 2 )) { // GOOD [FALSE POSITIVE]
147+ if (x == 10 || (x == 42 && x == 1 ) && (y = 2 )) { // GOOD
148148 }
149149
150150 if (x == 10 || ((x == 42 ) && (y = 2 )) && (z == 1 )) { // BAD
You can’t perform that action at this time.
0 commit comments