1 // RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \
2 // RUN:   -config='{CheckOptions: [ \
3 // RUN:     {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
4 // RUN:     {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
5 // RUN:     {key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes, value: ""}, \
6 // RUN:     {key: bugprone-easily-swappable-parameters.QualifiersMix, value: 1}, \
7 // RUN:     {key: bugprone-easily-swappable-parameters.ModelImplicitConversions, value: 1}, \
8 // RUN:     {key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether, value: 0}, \
9 // RUN:     {key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold, value: 0} \
10 // RUN:  ]}' --
11 
numericAndQualifierConversion(int I,const double CD)12 void numericAndQualifierConversion(int I, const double CD) { numericAndQualifierConversion(CD, I); }
13 // CHECK-MESSAGES: :[[@LINE-1]]:36: warning: 2 adjacent parameters of 'numericAndQualifierConversion' of convertible types are easily swapped by mistake [bugprone-easily-swappable-parameters]
14 // CHECK-MESSAGES: :[[@LINE-2]]:40: note: the first parameter in the range is 'I'
15 // CHECK-MESSAGES: :[[@LINE-3]]:56: note: the last parameter in the range is 'CD'
16 // CHECK-MESSAGES: :[[@LINE-4]]:43: note: 'int' and 'const double' parameters accept and bind the same kind of values
17 // CHECK-MESSAGES: :[[@LINE-5]]:43: note: 'int' and 'const double' may be implicitly converted: 'int' -> 'const double' (as 'double'), 'const double' (as 'double') -> 'int'
18