1 //===--- NamedParameterCheck.h - clang-tidy ---------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H 11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H 12 13 #include "../ClangTidy.h" 14 15 namespace clang { 16 namespace tidy { 17 namespace readability { 18 19 /// Find functions with unnamed arguments. 20 /// 21 /// The check implements the following rule originating in the Google C++ Style 22 /// Guide: 23 /// 24 /// https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions 25 /// 26 /// All parameters should be named, with identical names in the declaration and 27 /// implementation. 28 /// 29 /// Corresponding cpplint.py check name: 'readability/function'. 30 class NamedParameterCheck : public ClangTidyCheck { 31 public: NamedParameterCheck(StringRef Name,ClangTidyContext * Context)32 NamedParameterCheck(StringRef Name, ClangTidyContext *Context) 33 : ClangTidyCheck(Name, Context) {} 34 void registerMatchers(ast_matchers::MatchFinder *Finder) override; 35 void check(const ast_matchers::MatchFinder::MatchResult &Result) override; 36 }; 37 38 } // namespace readability 39 } // namespace tidy 40 } // namespace clang 41 42 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H 43