From c4c95813ae9946630db89d15f713cd1d1ffa4547 Mon Sep 17 00:00:00 2001 From: Whisperity Date: Tue, 5 Sep 2017 12:58:20 +0200 Subject: [PATCH] [clang-tidy] Add 'readability-suspicious-call-argument' check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Finds function calls where the call arguments might be provided in an incorrect order, based on the comparison (via string metrics) of the parameter names and the argument names against each other. A diagnostic is emitted if an argument name is similar to a *different* parameter than the one currently passed to, and it is sufficiently dissimilar to the one it **is** passed to currently. False-positive warnings from this check are useful to indicate bad naming convention issues, even if a swap isn't necessary. This check does not generate FixIts. Originally implemented by @varjujan as his Master's Thesis work. The check was subsequently taken over by @barancsuk who added type conformity checks to silence false positive matches. The work by @whisperity involved driving the check's review and fixing some more bugs in the process. Reviewed By: aaron.ballman, alexfh Differential Revision: http://reviews.llvm.org/D20689 Co-authored-by: János Varjú Co-authored-by: Lilla Barancsuk --- .../secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn b/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn index 2c8d8cb5c0f..89198c8b26b 100644 --- a/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn +++ b/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn @@ -48,6 +48,7 @@ static_library("readability") { "StaticAccessedThroughInstanceCheck.cpp", "StaticDefinitionInAnonymousNamespaceCheck.cpp", "StringCompareCheck.cpp", + "SuspiciousCallArgumentCheck.cpp", "UniqueptrDeleteReleaseCheck.cpp", "UppercaseLiteralSuffixCheck.cpp", "UseAnyOfAllOfCheck.cpp",