Index: clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp =================================================================== --- clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp +++ clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp @@ -90,6 +90,12 @@ return true; } +// We allow two names if one is a substring of the other, ignoring case. +// Important special case: this is true if either parameter has no name! +bool nameMatch(StringRef L, StringRef R) { + return L.contains_lower(R) || R.contains_lower(L); +} + DifferingParamsContainer findDifferingParamsInDeclaration(const FunctionDecl *ParameterSourceDeclaration, const FunctionDecl *OtherDeclaration, @@ -106,8 +112,7 @@ // FIXME: Provide a way to extract commented out parameter name from comment // next to it. - if (!SourceParamName.empty() && !OtherParamName.empty() && - SourceParamName != OtherParamName) { + if (!nameMatch(SourceParamName, OtherParamName)) { SourceRange OtherParamNameRange = DeclarationNameInfo((*OtherParamIt)->getDeclName(), (*OtherParamIt)->getLocation()) Index: test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp =================================================================== --- test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp +++ test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp @@ -2,6 +2,8 @@ void consistentFunction(int a, int b, int c); void consistentFunction(int a, int b, int c); +void consistentFunction(int prefixA, int inBFix, int cSuffix); +void consistentFunction(int a, int b, int c); void consistentFunction(int a, int b, int /*c*/); void consistentFunction(int /*c*/, int /*c*/, int /*c*/);