mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C++: Add testcase demonstrating false positive
This commit is contained in:
@@ -14,3 +14,4 @@
|
||||
| test.cpp:84:7:84:11 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:92:17:92:22 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:113:6:113:10 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:124:6:124:15 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
|
||||
@@ -116,4 +116,11 @@ void h() {
|
||||
|
||||
void f() {
|
||||
h<int>();
|
||||
}
|
||||
|
||||
void f2() {
|
||||
const char* sz = "abc";
|
||||
|
||||
if(sz = "def") { // GOOD [FALSE POSITIVE]: a == comparison with a string literal is probably not the intent here
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user