[clang-tidy] google-readability-function: skip std::nullptr_t

Parameters of type std::nullptr_t can only have one value, so it doesn't make
sense to name them.

llvm-svn: 221340
This commit is contained in:
Alexander Kornienko 2014-11-05 11:08:39 +00:00
parent 502fac38e9
commit e20ce07a2f
2 changed files with 10 additions and 0 deletions

View File

@ -65,6 +65,10 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
if (Typedef->getDecl()->getQualifiedNameAsString() == "testing::Unused")
continue;
// Skip std::nullptr_t.
if (Parm->getType().getCanonicalType()->isNullPtrType())
continue;
// Look for comments. We explicitly want to allow idioms like
// void foo(int /*unused*/)
const char *Begin = SM.getCharacterData(Parm->getLocStart());

View File

@ -122,3 +122,9 @@ void MockFunction(Unused, int q, Unused) {
++q;
++q;
}
namespace std {
typedef decltype(nullptr) nullptr_t;
}
void f(std::nullptr_t) {}