[clang-tools-extra] r252248 - [clang-tidy] readability-named-parameter: don't complain about implicit parameters
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 5 16:19:21 PST 2015
Author: alexfh
Date: Thu Nov 5 18:19:21 2015
New Revision: 252248
URL: http://llvm.org/viewvc/llvm-project?rev=252248&view=rev
Log:
[clang-tidy] readability-named-parameter: don't complain about implicit parameters
Fixes http://llvm.org/PR24464.
Modified:
clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp
Modified: clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp?rev=252248&r1=252247&r2=252248&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.cpp Thu Nov 5 18:19:21 2015
@@ -45,6 +45,8 @@ void NamedParameterCheck::check(const Ma
// arguments in the same position.
for (unsigned I = 0, E = Function->getNumParams(); I != E; ++I) {
const ParmVarDecl *Parm = Function->getParamDecl(I);
+ if (Parm->isImplicit())
+ continue;
// Look for unnamed parameters.
if (!Parm->getName().empty())
continue;
Modified: clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp?rev=252248&r1=252247&r2=252248&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-named-parameter.cpp Thu Nov 5 18:19:21 2015
@@ -127,3 +127,7 @@ typedef decltype(nullptr) nullptr_t;
}
void f(std::nullptr_t) {}
+
+typedef void (F)(int);
+F f;
+void f(int x) {}
More information about the cfe-commits
mailing list