| 1 |
// RUN: %check_clang_tidy %s bugprone-easily-swappable-parameters %t \ |
| 2 |
// RUN: -config='{CheckOptions: { \ |
| 3 |
// RUN: bugprone-easily-swappable-parameters.MinimumLength: 2, \ |
| 4 |
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterNames: "", \ |
| 5 |
// RUN: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes: "", \ |
| 6 |
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 1, \ |
| 7 |
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \ |
| 8 |
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \ |
| 9 |
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \ |
| 10 |
// RUN: }}' -- |
| 11 |
|
| 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' |