codeql-coding-standards
codeql-coding-standards copied to clipboard
`A3-9-1`: Incorrectly alerts on template functions instantiated with fix-width integers
Affected rules
- cpp/autosar/variable-width-integer-types-used
Description
Template instantiations store the template argument after type definitions have been resolved. This results in argument types with variable width integer types even though the template is instantiated with fixed-width integers.
Additionally, we want to change the location of the alerts in case of template instantiations to the location where the template is instantiated because that is where the rule violation happens.
Example
template <typename T>
void foo(T value) { ... }
}