clang-tools  5.0.0
MoveConstructorInitCheck.h
Go to the documentation of this file.
1 //===--- MoveConstructorInitCheck.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_MISC_MOVECONSTRUCTORINITCHECK_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MOVECONSTRUCTORINITCHECK_H
12 
13 #include "../ClangTidy.h"
14 #include "../utils/IncludeInserter.h"
15 
16 #include <memory>
17 
18 namespace clang {
19 namespace tidy {
20 namespace misc {
21 
22 /// The check flags user-defined move constructors that have a ctor-initializer
23 /// initializing a member or base class through a copy constructor instead of a
24 /// move constructor.
25 /// For the user-facing documentation see:
26 /// http://clang.llvm.org/extra/clang-tidy/checks/misc-move-constructor-init.html
28 public:
30  void registerMatchers(ast_matchers::MatchFinder *Finder) override;
31  void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
32  void registerPPCallbacks(clang::CompilerInstance &Compiler) override;
33  void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
34 
35 private:
36  std::unique_ptr<utils::IncludeInserter> Inserter;
37  const utils::IncludeSorter::IncludeStyle IncludeStyle;
38 };
39 
40 } // namespace misc
41 } // namespace tidy
42 } // namespace clang
43 
44 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MOVECONSTRUCTORINITCHECK_H
StringHandle Name
std::unique_ptr< ast_matchers::MatchFinder > Finder
Definition: ClangTidy.cpp:275
IncludeStyle
Supported include styles.
Definition: IncludeSorter.h:27
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
void registerPPCallbacks(clang::CompilerInstance &Compiler) override
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
std::map< std::string, std::string > OptionMap
The check flags user-defined move constructors that have a ctor-initializer initializing a member or ...
ClangTidyContext & Context
Definition: ClangTidy.cpp:87
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
MoveConstructorInitCheck(StringRef Name, ClangTidyContext *Context)
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.