diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 6 | ||||
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp (renamed from clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.cpp) | 9 | ||||
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h (renamed from clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.h) | 12 |
4 files changed, 15 insertions, 14 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt index ca7250a8a42..961ffde566a 100644 --- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt @@ -8,7 +8,7 @@ add_clang_library(clangTidyMiscModule InaccurateEraseCheck.cpp InefficientAlgorithmCheck.cpp MiscTidyModule.cpp - NoexceptMoveCtorsCheck.cpp + NoexceptMoveConstructorCheck.cpp StaticAssertCheck.cpp SwappedArgumentsCheck.cpp UndelegatedConstructor.cpp diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index 36e6d401a61..21248d5ab09 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -16,7 +16,7 @@ #include "BoolPointerImplicitConversionCheck.h" #include "InaccurateEraseCheck.h" #include "InefficientAlgorithmCheck.h" -#include "NoexceptMoveCtorsCheck.h" +#include "NoexceptMoveConstructorCheck.h" #include "StaticAssertCheck.h" #include "SwappedArgumentsCheck.h" #include "UndelegatedConstructor.h" @@ -42,8 +42,8 @@ public: "misc-inaccurate-erase"); CheckFactories.registerCheck<InefficientAlgorithmCheck>( "misc-inefficient-algorithm"); - CheckFactories.registerCheck<NoexceptMoveCtorsCheck>( - "misc-noexcept-move-ctors"); + CheckFactories.registerCheck<NoexceptMoveConstructorCheck>( + "misc-noexcept-move-constructor"); CheckFactories.registerCheck<StaticAssertCheck>( "misc-static-assert"); CheckFactories.registerCheck<SwappedArgumentsCheck>( diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp index b33e908fd8f..7bc7835efcb 100644 --- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp @@ -1,4 +1,4 @@ -//===--- NoexceptMoveCtorsCheck.cpp - clang-tidy---------------------------===// +//===--- NoexceptMoveConstructorCheck.cpp - clang-tidy---------------------===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "NoexceptMoveCtorsCheck.h" +#include "NoexceptMoveConstructorCheck.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" @@ -16,7 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { -void NoexceptMoveCtorsCheck::registerMatchers(MatchFinder *Finder) { +void NoexceptMoveConstructorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( methodDecl(anyOf(constructorDecl(), hasOverloadedOperatorName("=")), unless(isImplicit()), unless(isDeleted())) @@ -24,7 +24,8 @@ void NoexceptMoveCtorsCheck::registerMatchers(MatchFinder *Finder) { this); } -void NoexceptMoveCtorsCheck::check(const MatchFinder::MatchResult &Result) { +void NoexceptMoveConstructorCheck::check( + const MatchFinder::MatchResult &Result) { if (const auto *Decl = Result.Nodes.getNodeAs<CXXMethodDecl>("decl")) { StringRef MethodType = "assignment operator"; if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(Decl)) { diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.h b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h index 0e3747cd627..d176a604177 100644 --- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveCtorsCheck.h +++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h @@ -1,4 +1,4 @@ -//===--- NoexceptMoveCtorsCheck.h - clang-tidy-------------------*- C++ -*-===// +//===--- NoexceptMoveConstructorCheck.h - clang-tidy-------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPT_MOVE_CTORS_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPT_MOVE_CTORS_H +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPTMOVECONSTRUCTORCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPTMOVECONSTRUCTORCHECK_H #include "../ClangTidy.h" @@ -22,9 +22,9 @@ namespace tidy { /// Move constructors of all the types used with STL containers, for example, /// need to be declared \c noexcept. Otherwise STL will choose copy constructors /// instead. The same is valid for move assignment operations. -class NoexceptMoveCtorsCheck : public ClangTidyCheck { +class NoexceptMoveConstructorCheck : public ClangTidyCheck { public: - NoexceptMoveCtorsCheck(StringRef Name, ClangTidyContext *Context) + NoexceptMoveConstructorCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context) {} void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; @@ -33,5 +33,5 @@ public: } // namespace tidy } // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPT_MOVE_CTORS_H +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_NOEXCEPTMOVECONSTRUCTORCHECK_H |

