mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C++: Suppress pointless compare in template inst.
It still runs on uninstantiated templates because its underlying libraries do. It's not clear whether that leads to other false positives, but that's independent of the change I'm making here.
This commit is contained in:
@@ -32,7 +32,4 @@
|
||||
| PointlessComparison.c:129:12:129:16 | ... > ... | Comparison is always false because a <= 3. |
|
||||
| PointlessComparison.c:197:7:197:11 | ... < ... | Comparison is always false because x >= 0. |
|
||||
| RegressionTests.cpp:57:7:57:22 | ... <= ... | Comparison is always true because * ... <= 4294967295. |
|
||||
| Templates.cpp:3:10:3:24 | ... <= ... | Comparison is always true because param <= 32767. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
template<typename T>
|
||||
bool sometimesPointless(T param) {
|
||||
return param <= 0xFFFF; // GOOD (FALSE POSITIVE: hypothetical instantiations are okay)
|
||||
return param <= 0xFFFF; // GOOD (hypothetical instantiations are okay)
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user