codeql-coding-standards icon indicating copy to clipboard operation
codeql-coding-standards copied to clipboard

`A3-9-1`: Incorrectly alerts on template functions instantiated with fix-width integers

Open rvermeulen opened this issue 1 year ago • 0 comments

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) { ... }
}

rvermeulen avatar Feb 21 '24 00:02 rvermeulen