File tree 3 files changed +18
-1
lines changed
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 32
32
typeStrippedOfSpecifiers instanceof SignedCharType
33
33
) and
34
34
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
35
39
//post-increment/post-decrement operators are required by the standard to have a dummy int parameter
36
40
not v .( Parameter ) .getFunction ( ) instanceof PostIncrementOperator and
37
41
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() {
75
75
struct test_fix_fp_614 {
76
76
test_fix_fp_614 operator ++(int ); // COMPLIANT
77
77
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