File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ - ` A3-9-1 ` - ` VariableWidthIntegerTypesUsed.ql ` :
2+ - Reduce false positives by not considering variables from template instantiations.
Original file line number Diff line number Diff line change 3232 typeStrippedOfSpecifiers instanceof SignedCharType
3333 ) and
3434 not v instanceof ExcludedVariable and
35+ // Dont consider template instantiations because instantiations with
36+ // Fixed Width Types are recorded after stripping their typedef'd type,
37+ // thereby, causing false positives (#540).
38+ not v .isFromTemplateInstantiation ( _) and
3539 //post-increment/post-decrement operators are required by the standard to have a dummy int parameter
3640 not v .( Parameter ) .getFunction ( ) instanceof PostIncrementOperator and
3741 not v .( Parameter ) .getFunction ( ) instanceof PostDecrementOperator
Original file line number Diff line number Diff line change @@ -75,4 +75,15 @@ void test_variable_width_type_qualified_variables() {
7575struct test_fix_fp_614 {
7676 test_fix_fp_614 operator ++(int ); // COMPLIANT
7777 test_fix_fp_614 operator --(int ); // COMPLIANT
78- };
78+ };
79+
80+ // COMPLIANT - instantiated with Fixed Width Types.
81+ template <typename MyType> constexpr void test_fix_fp_540 (MyType value) {
82+ value++;
83+ }
84+
85+ int call_test_fix_fp_540 () {
86+ test_fix_fp_540<std::uint8_t >(19 );
87+ test_fix_fp_540<std::int16_t >(20 );
88+ return 0 ;
89+ }
You can’t perform that action at this time.
0 commit comments