Index: clang-tidy/misc/ArgumentCommentCheck.h =================================================================== --- clang-tidy/misc/ArgumentCommentCheck.h +++ clang-tidy/misc/ArgumentCommentCheck.h @@ -15,6 +15,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Checks that argument comments match parameter names. class ArgumentCommentCheck : public ClangTidyCheck { @@ -36,6 +37,7 @@ llvm::ArrayRef Args); }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/ArgumentCommentCheck.cpp =================================================================== --- clang-tidy/misc/ArgumentCommentCheck.cpp +++ clang-tidy/misc/ArgumentCommentCheck.cpp @@ -17,6 +17,7 @@ namespace clang { namespace tidy { +namespace misc { ArgumentCommentCheck::ArgumentCommentCheck(StringRef Name, ClangTidyContext *Context) @@ -181,5 +182,6 @@ } } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/AssignOperatorSignatureCheck.h =================================================================== --- clang-tidy/misc/AssignOperatorSignatureCheck.h +++ clang-tidy/misc/AssignOperatorSignatureCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Finds declarations of assign operators with the wrong return and/or /// argument types. @@ -29,6 +30,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/AssignOperatorSignatureCheck.cpp =================================================================== --- clang-tidy/misc/AssignOperatorSignatureCheck.cpp +++ clang-tidy/misc/AssignOperatorSignatureCheck.cpp @@ -15,6 +15,7 @@ namespace clang { namespace tidy { +namespace misc { void AssignOperatorSignatureCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -63,5 +64,6 @@ } } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/BoolPointerImplicitConversion.h =================================================================== --- clang-tidy/misc/BoolPointerImplicitConversion.h +++ clang-tidy/misc/BoolPointerImplicitConversion.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Checks for conditions based on implicit conversion from a bool /// pointer to bool e.g. @@ -29,6 +30,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/BoolPointerImplicitConversion.cpp =================================================================== --- clang-tidy/misc/BoolPointerImplicitConversion.cpp +++ clang-tidy/misc/BoolPointerImplicitConversion.cpp @@ -22,6 +22,7 @@ } // namespace ast_matchers namespace tidy { +namespace misc { void BoolPointerImplicitConversion::registerMatchers(MatchFinder *Finder) { // Look for ifs that have an implicit bool* to bool conversion in the @@ -71,5 +72,6 @@ << FixItHint::CreateInsertion(Var->getLocStart(), "*"); } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/InaccurateEraseCheck.h =================================================================== --- clang-tidy/misc/InaccurateEraseCheck.h +++ clang-tidy/misc/InaccurateEraseCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Checks for inaccurate use of \c erase() method. /// @@ -30,6 +31,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/InaccurateEraseCheck.cpp =================================================================== --- clang-tidy/misc/InaccurateEraseCheck.cpp +++ clang-tidy/misc/InaccurateEraseCheck.cpp @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace misc { void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) { const auto CheckForEndCall = hasArgument( @@ -60,5 +61,6 @@ << Hint; } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/InefficientAlgorithmCheck.h =================================================================== --- clang-tidy/misc/InefficientAlgorithmCheck.h +++ clang-tidy/misc/InefficientAlgorithmCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Warns on inefficient use of STL algorithms on associative containers. /// @@ -28,6 +29,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/InefficientAlgorithmCheck.cpp =================================================================== --- clang-tidy/misc/InefficientAlgorithmCheck.cpp +++ clang-tidy/misc/InefficientAlgorithmCheck.cpp @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace misc { static bool areTypesCompatible(QualType Left, QualType Right) { if (const auto *LeftRefType = Left->getAs()) @@ -123,5 +124,6 @@ << Hint; } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/MiscTidyModule.cpp =================================================================== --- clang-tidy/misc/MiscTidyModule.cpp +++ clang-tidy/misc/MiscTidyModule.cpp @@ -23,6 +23,7 @@ namespace clang { namespace tidy { +namespace misc { class MiscModule : public ClangTidyModule { public: @@ -47,8 +48,10 @@ } }; +} // namespace misc + // Register the MiscTidyModule using this statically initialized variable. -static ClangTidyModuleRegistry::Add +static ClangTidyModuleRegistry::Add X("misc-module", "Adds miscellaneous lint checks."); // This anchor is used to force the linker to link in the generated object file Index: clang-tidy/misc/SwappedArgumentsCheck.h =================================================================== --- clang-tidy/misc/SwappedArgumentsCheck.h +++ clang-tidy/misc/SwappedArgumentsCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Finds potentially swapped arguments by looking at implicit /// conversions. @@ -25,8 +26,8 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SWAPPED_ARGUMENTS_CHECK_H - Index: clang-tidy/misc/SwappedArgumentsCheck.cpp =================================================================== --- clang-tidy/misc/SwappedArgumentsCheck.cpp +++ clang-tidy/misc/SwappedArgumentsCheck.cpp @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace misc { void SwappedArgumentsCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(callExpr().bind("call"), this); @@ -121,5 +122,6 @@ } } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UndelegatedConstructor.h =================================================================== --- clang-tidy/misc/UndelegatedConstructor.h +++ clang-tidy/misc/UndelegatedConstructor.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Finds creation of temporary objects in constructors that look like a /// function call to another constructor of the same class. The user most likely @@ -26,6 +27,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UndelegatedConstructor.cpp =================================================================== --- clang-tidy/misc/UndelegatedConstructor.cpp +++ clang-tidy/misc/UndelegatedConstructor.cpp @@ -46,6 +46,7 @@ } // namespace ast_matchers namespace tidy { +namespace misc { void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) { // We look for calls to constructors of the same type in constructors. To do @@ -70,5 +71,6 @@ "A temporary object is created here instead"); } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UniqueptrResetRelease.h =================================================================== --- clang-tidy/misc/UniqueptrResetRelease.h +++ clang-tidy/misc/UniqueptrResetRelease.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Find and replace unique_ptr::reset(release()) with std::move /// @@ -32,6 +33,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UniqueptrResetRelease.cpp =================================================================== --- clang-tidy/misc/UniqueptrResetRelease.cpp +++ clang-tidy/misc/UniqueptrResetRelease.cpp @@ -15,6 +15,7 @@ namespace clang { namespace tidy { +namespace misc { void UniqueptrResetRelease::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -62,5 +63,6 @@ CharSourceRange::getTokenRange(ResetCall->getSourceRange()), NewText); } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UnusedRAII.h =================================================================== --- clang-tidy/misc/UnusedRAII.h +++ clang-tidy/misc/UnusedRAII.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Finds temporaries that look like RAII objects. /// @@ -43,6 +44,7 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UnusedRAII.cpp =================================================================== --- clang-tidy/misc/UnusedRAII.cpp +++ clang-tidy/misc/UnusedRAII.cpp @@ -22,6 +22,7 @@ } // namespace ast_matchers namespace tidy { +namespace misc { void UnusedRAIICheck::registerMatchers(MatchFinder *Finder) { // Look for temporaries that are constructed in-place and immediately @@ -79,5 +80,6 @@ Replacement); } +} // namespace misc } // namespace tidy } // namespace clang Index: clang-tidy/misc/UseOverride.h =================================================================== --- clang-tidy/misc/UseOverride.h +++ clang-tidy/misc/UseOverride.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// \brief Use C++11's 'override' and remove 'virtual' where applicable. class UseOverride : public ClangTidyCheck { @@ -24,8 +25,8 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_USE_OVERRIDE_H - Index: clang-tidy/misc/UseOverride.cpp =================================================================== --- clang-tidy/misc/UseOverride.cpp +++ clang-tidy/misc/UseOverride.cpp @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace misc { void UseOverride::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(methodDecl(isOverride()).bind("method"), this); @@ -175,5 +176,6 @@ } } +} // namespace misc } // namespace tidy } // namespace clang Index: unittests/clang-tidy/MiscModuleTest.cpp =================================================================== --- unittests/clang-tidy/MiscModuleTest.cpp +++ unittests/clang-tidy/MiscModuleTest.cpp @@ -6,6 +6,7 @@ namespace clang { namespace tidy { +using misc::ArgumentCommentCheck; using readability::BracesAroundStatementsCheck; namespace test {