clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

NamedParameterCheck.h
Go to the documentation of this file.
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 /// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#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:
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
Name
StringHandle Name
Definition: PreprocessorTracker.cpp:525
Finder
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:188
clang::tidy::readability::NamedParameterCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: NamedParameterCheck.cpp:25
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:102
clang::tidy::readability::NamedParameterCheck::NamedParameterCheck
NamedParameterCheck(StringRef Name, ClangTidyContext *Context)
Definition: NamedParameterCheck.h:32
clang::tidy::readability::NamedParameterCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register ASTMatchers with Finder.
Definition: NamedParameterCheck.cpp:21
clang::tidy::readability::NamedParameterCheck
Find functions with unnamed arguments.
Definition: NamedParameterCheck.h:30
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:124
Result
const NamedDecl * Result
Definition: USRFinder.cpp:121