From: Etienne Bergeron Date: Mon, 2 May 2016 18:00:29 +0000 (+0000) Subject: [clang-tidy] Cleaning namespaces to be more consistant across checkers. X-Git-Tag: llvmorg-3.9.0-rc1~7250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=456177b98fa3d807007ccfe671aae02691480e5a;p=platform%2Fupstream%2Fllvm.git [clang-tidy] Cleaning namespaces to be more consistant across checkers. Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264 --- diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp index d5e4168..6ba0206 100644 --- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp @@ -40,7 +40,7 @@ public: CheckFactories.registerCheck( "cert-dcl59-cpp"); // OOP - CheckFactories.registerCheck( + CheckFactories.registerCheck( "cert-oop11-cpp"); // ERR CheckFactories.registerCheck( @@ -49,12 +49,12 @@ public: "cert-err58-cpp"); CheckFactories.registerCheck( "cert-err60-cpp"); - CheckFactories.registerCheck( + CheckFactories.registerCheck( "cert-err61-cpp"); // C checkers // DCL - CheckFactories.registerCheck( + CheckFactories.registerCheck( "cert-dcl03-c"); // ENV CheckFactories.registerCheck( @@ -63,7 +63,7 @@ public: CheckFactories.registerCheck( "cert-flp30-c"); // FIO - CheckFactories.registerCheck( + CheckFactories.registerCheck( "cert-fio38-c"); // ERR CheckFactories.registerCheck( diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp index 8a37b1b..bfcef89 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { AST_MATCHER_P(CXXForRangeStmt, hasRangeBeginEndStmt, ast_matchers::internal::Matcher, InnerMatcher) { @@ -74,5 +75,6 @@ void ProBoundsArrayToPointerDecayCheck::check( "an explicit cast instead"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h index ec6979a..b376e64 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h @@ -14,7 +14,8 @@ namespace clang { namespace tidy { - +namespace cppcoreguidelines { + /// This check flags all array to pointer decays /// /// For the user-facing documentation see: @@ -27,6 +28,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp index a8dc1d8..30792e7 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp @@ -17,6 +17,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { ProBoundsConstantArrayIndexCheck::ProBoundsConstantArrayIndexCheck( StringRef Name, ClangTidyContext *Context) @@ -128,5 +129,6 @@ void ProBoundsConstantArrayIndexCheck::check( } } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h index 1caf28c..b83475c 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.h @@ -15,6 +15,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// This checks that all array subscriptions on static arrays and std::arrays /// have a constant index and are within bounds @@ -34,6 +35,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp index 9dcd7c4..da85093 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { void ProBoundsPointerArithmeticCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -53,5 +54,6 @@ ProBoundsPointerArithmeticCheck::check(const MatchFinder::MatchResult &Result) { diag(MatchedExpr->getExprLoc(), "do not use pointer arithmetic"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h index f3a3fb1..6f330cf 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// Flags all kinds of pointer arithmetic that have result of pointer type, i.e. /// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on arrays) is flagged. @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp index 6b32ad0..5331cda 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp @@ -15,7 +15,8 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { - +namespace cppcoreguidelines { + void ProTypeConstCastCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) return; @@ -28,5 +29,6 @@ void ProTypeConstCastCheck::check(const MatchFinder::MatchResult &Result) { diag(MatchedCast->getOperatorLoc(), "do not use const_cast"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h index af7c554..fda082e 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.h @@ -14,7 +14,8 @@ namespace clang { namespace tidy { - +namespace cppcoreguidelines { + /// This check flags all instances of const_cast /// /// For the user-facing documentation see: @@ -27,6 +28,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp index 542dd85..4055423 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { static bool needsConstCast(QualType SourceType, QualType DestType) { SourceType = SourceType.getNonReferenceType(); @@ -103,5 +104,6 @@ void ProTypeCstyleCastCheck::check(const MatchFinder::MatchResult &Result) { } } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h index f85be87..c08b883c 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// This check flags all use of C-style casts that perform a static_cast /// downcast, const_cast, or reinterpret_cast. @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp index 57c4a59..e56e638 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { void ProTypeReinterpretCastCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -30,5 +31,6 @@ void ProTypeReinterpretCastCheck::check( diag(MatchedCast->getOperatorLoc(), "do not use reinterpret_cast"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h index 0ca16e5..9610546 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// Flags all occurrences of reinterpret_cast /// @@ -27,6 +28,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp index 0033e4e..002f8f1 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp @@ -15,7 +15,8 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { - +namespace cppcoreguidelines { + void ProTypeStaticCastDowncastCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) return; @@ -48,5 +49,6 @@ void ProTypeStaticCastDowncastCheck::check(const MatchFinder::MatchResult &Resul "do not use static_cast to downcast from a base to a derived class"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h index 02de48a..d718fec 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.h @@ -14,7 +14,8 @@ namespace clang { namespace tidy { - +namespace cppcoreguidelines { + /// Checks for usages of static_cast, where a base class is downcasted to a derived class. /// /// For the user-facing documentation see: @@ -27,6 +28,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp index 64f5136..5233ad8 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -28,6 +29,7 @@ void ProTypeUnionAccessCheck::check(const MatchFinder::MatchResult &Result) { diag(Matched->getMemberLoc(), "do not access members of unions; use (boost::)variant instead"); } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h index 67ce616..28097fa 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// This check flags all access to members of unions. /// Access to a union as a whole (e.g. passing to a function) is not flagged. @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp index 526016e..680037f 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace cppcoreguidelines { const internal::VariadicDynCastAllOfMatcher vAArgExpr; @@ -72,5 +73,6 @@ void ProTypeVarargCheck::check(const MatchFinder::MatchResult &Result) { } } +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h index fd1f9bf..558c856 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace cppcoreguidelines { /// This check flags all calls to c-style variadic functions and all use /// of va_arg. @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace cppcoreguidelines } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp index 8d63ec5..7bfbd3b 100644 --- a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.cpp @@ -21,6 +21,9 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { + namespace { AST_MATCHER_P(Expr, hasSideEffect, bool, CheckFunctionCalls) { @@ -66,8 +69,6 @@ AST_MATCHER_P(Expr, hasSideEffect, bool, CheckFunctionCalls) { } // namespace -namespace tidy { - AssertSideEffectCheck::AssertSideEffectCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -121,5 +122,6 @@ void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) { diag(Loc, "found %0() with side effect") << AssertMacroName; } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h index 1ca278d..2bb25e2 100644 --- a/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h +++ b/clang-tools-extra/clang-tidy/misc/AssertSideEffectCheck.h @@ -17,6 +17,7 @@ namespace clang { namespace tidy { +namespace misc { /// Finds `assert()` with side effect. /// @@ -44,6 +45,7 @@ private: SmallVector AssertMacros; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp b/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp index 603401a..da295be 100644 --- a/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp @@ -12,6 +12,9 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { + namespace { AST_MATCHER(CastExpr, isPointerToBoolean) { @@ -20,9 +23,6 @@ AST_MATCHER(CastExpr, isPointerToBoolean) { } // namespace -namespace tidy { -namespace misc { - void BoolPointerImplicitConversionCheck::registerMatchers(MatchFinder *Finder) { // Look for ifs that have an implicit bool* to bool conversion in the // condition. Filter negations. diff --git a/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp b/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp index bf0ef4f..9a487b8 100644 --- a/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp +++ b/clang-tools-extra/clang-tidy/misc/IncorrectRoundings.cpp @@ -14,8 +14,13 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" +using namespace clang::ast_matchers; + namespace clang { -namespace ast_matchers { +namespace tidy { +namespace misc { + +namespace { AST_MATCHER(FloatingLiteral, floatHalf) { const auto &literal = Node.getValue(); if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle) @@ -24,14 +29,9 @@ AST_MATCHER(FloatingLiteral, floatHalf) { return literal.convertToDouble() == 0.5; return false; } -} // namespace ast_matchers -} // namespace clang +} // namespace -using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { void IncorrectRoundings::registerMatchers(MatchFinder *MatchFinder) { // Match a floating literal with value 0.5. auto FloatHalf = floatLiteral(floatHalf()); diff --git a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp index 86e5d27..4b3e1ca 100644 --- a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.cpp @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { namespace { class MacroParenthesesPPCallbacks : public PPCallbacks { @@ -198,5 +199,6 @@ void MacroParenthesesCheck::registerPPCallbacks(CompilerInstance &Compiler) { &Compiler.getPreprocessor(), this)); } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h index f4a79c0..e398fc6 100644 --- a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h +++ b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// Finds macros that can have unexpected behaviour due to missing parentheses. /// @@ -35,6 +36,7 @@ public: void registerPPCallbacks(CompilerInstance &Compiler) override; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp index d8e8175..30330c3 100644 --- a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.cpp @@ -9,14 +9,14 @@ #include "MoveConstantArgumentCheck.h" -#include +#include "clang/Lex/Lexer.h" + +using namespace clang::ast_matchers; namespace clang { namespace tidy { namespace misc { -using namespace ast_matchers; - void MoveConstantArgumentCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) return; diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp index eeebcf6..0072c0c 100644 --- a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.cpp @@ -19,6 +19,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { namespace { @@ -175,5 +176,6 @@ void MoveConstructorInitCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "IncludeStyle", IncludeSorter::toString(IncludeStyle)); } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h index c9bac19..4544c1c 100644 --- a/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h +++ b/clang-tools-extra/clang-tidy/misc/MoveConstructorInitCheck.h @@ -17,6 +17,7 @@ namespace clang { namespace tidy { +namespace misc { /// The check flags user-defined move constructors that have a ctor-initializer /// initializing a member or base class through a copy constructor instead of a @@ -42,6 +43,7 @@ private: const bool UseCERTSemantics; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp index 8f40dc6..4da5006 100644 --- a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp @@ -14,7 +14,11 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { + namespace { + AST_MATCHER(FunctionDecl, isPlacementOverload) { bool New; switch (Node.getOverloadedOperator()) { @@ -57,12 +61,7 @@ AST_MATCHER(FunctionDecl, isPlacementOverload) { return true; } -} // namespace -namespace tidy { -namespace misc { - -namespace { OverloadedOperatorKind getCorrespondingOverload(const FunctionDecl *FD) { switch (FD->getOverloadedOperator()) { default: break; @@ -125,6 +124,7 @@ bool hasCorrespondingOverloadInBaseClass(const CXXMethodDecl *MD, return false; } + } // anonymous namespace void NewDeleteOverloadsCheck::registerMatchers(MatchFinder *Finder) { diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp index 1a22e17..769efe4 100644 --- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { void NoexceptMoveConstructorCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++11; the functionality currently does not @@ -67,6 +68,7 @@ void NoexceptMoveConstructorCheck::check( } } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h index db0f297..0c976af 100644 --- a/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h +++ b/clang-tools-extra/clang-tidy/misc/NoexceptMoveConstructorCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// The check flags user-defined move constructors and assignment operators not /// marked with `noexcept` or marked with `noexcept(expr)` where `expr` @@ -30,6 +31,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp index 929bc0c..8bc558f 100644 --- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp +++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp @@ -15,6 +15,9 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { + namespace { // FIXME: it would be good to make a list that is also user-configurable so that // users can add their own elements to the list. However, it may require some @@ -49,7 +52,6 @@ AST_MATCHER(NamedDecl, isPOSIXType) { } } // namespace -namespace tidy { void NonCopyableObjectsCheck::registerMatchers(MatchFinder *Finder) { // There are two ways to get into trouble with objects like FILE *: // dereferencing the pointer type to be a non-pointer type, and declaring @@ -91,6 +93,7 @@ void NonCopyableObjectsCheck::check(const MatchFinder::MatchResult &Result) { << BD; } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h index c812e50..9805f74 100644 --- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h +++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// The check flags dereferences and non-pointer declarations of objects that /// are not meant to be passed by value, such as C FILE objects. @@ -25,6 +26,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp index cd26426..d591e46 100644 --- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.cpp @@ -15,6 +15,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -43,6 +44,7 @@ void SizeofContainerCheck::check(const MatchFinder::MatchResult &Result) { "container; did you mean .size()?"); } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h index eae5a06..c17bbbd 100644 --- a/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h +++ b/clang-tools-extra/clang-tidy/misc/SizeofContainerCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// Find usages of sizeof on expressions of STL container types. Most likely the /// user wanted to use `.size()` instead. @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp index c9793bc..2b08cd5 100644 --- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp @@ -22,6 +22,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { StaticAssertCheck::StaticAssertCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context) {} @@ -164,5 +165,6 @@ SourceLocation StaticAssertCheck::getLastParenLoc(const ASTContext *ASTCtx, return Token.getLocation(); } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h index b3b1cb5..284fdeb 100644 --- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h +++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.h @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace misc { /// Replaces `assert()` with `static_assert()` if the condition is evaluatable /// at compile time. @@ -33,6 +34,7 @@ private: SourceLocation AssertLoc); }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp index c9ed466..65af4a1 100644 --- a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { void StringIntegerAssignmentCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus) @@ -81,5 +82,6 @@ void StringIntegerAssignmentCheck::check( } } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h index 072b96a..e977b57 100644 --- a/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h +++ b/clang-tools-extra/clang-tidy/misc/StringIntegerAssignmentCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// Finds instances where an integer is assigned to a string. /// @@ -27,6 +28,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp index 3fbbe8e..5e89bd1 100644 --- a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { ThrowByValueCatchByReferenceCheck::ThrowByValueCatchByReferenceCheck( StringRef Name, ClangTidyContext *Context) @@ -155,5 +156,6 @@ void ThrowByValueCatchByReferenceCheck::diagnoseCatchLocations( } } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h index 7030031..a2e7df7 100644 --- a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h +++ b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { ///\brief checks for locations that do not throw by value // or catch by reference. @@ -43,6 +44,7 @@ private: const bool CheckAnonymousTemporaries; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp index 90135e3..3b6f198 100644 --- a/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp +++ b/clang-tools-extra/clang-tidy/misc/UndelegatedConstructor.cpp @@ -14,6 +14,8 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { namespace { AST_MATCHER_P(Stmt, ignoringTemporaryExpr, @@ -46,9 +48,6 @@ AST_MATCHER_P(CXXRecordDecl, baseOfBoundNode, std::string, ID) { } } // namespace -namespace tidy { -namespace misc { - void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) { // We look for calls to constructors of the same type in constructors. To do // this we have to look through a variety of nodes that occur in the path, diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index d9a1296..fb18059 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { void UnusedAliasDeclsCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++11; the functionality currently does not @@ -58,5 +59,6 @@ void UnusedAliasDeclsCheck::onEndOfTranslationUnit() { } } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h index 6606b73..54f66f7 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.h @@ -15,6 +15,7 @@ namespace clang { namespace tidy { +namespace misc { /// Finds unused namespace alias declarations. class UnusedAliasDeclsCheck : public ClangTidyCheck { @@ -29,6 +30,7 @@ private: llvm::DenseMap FoundDecls; }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp index b2504d4..6131132 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp @@ -16,6 +16,8 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace misc { + namespace { bool isOverrideMethod(const FunctionDecl *Function) { if (const auto *MD = dyn_cast(Function)) @@ -120,5 +122,6 @@ void UnusedParametersCheck::check(const MatchFinder::MatchResult &Result) { } } +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h index 595f3a7..45b7f93 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h +++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace misc { /// Finds unused parameters and fixes them, so that `-Wunused-parameter` can be /// turned on. @@ -30,6 +31,7 @@ private: const FunctionDecl *Function, unsigned ParamIndex); }; +} // namespace misc } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp index e62b31d..a1fac9f 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedRAIICheck.cpp @@ -14,6 +14,9 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace misc { + namespace { AST_MATCHER(CXXRecordDecl, hasNonTrivialDestructor) { // TODO: If the dtor is there but empty we don't want to warn either. @@ -21,9 +24,6 @@ AST_MATCHER(CXXRecordDecl, hasNonTrivialDestructor) { } } // namespace -namespace tidy { -namespace misc { - void UnusedRAIICheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++; the functionality currently does not // provide any benefit to other languages, despite being benign. diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h index aabd435..1a1e135 100644 --- a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h @@ -11,7 +11,6 @@ #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H #include "../ClangTidy.h" -//#include namespace clang { namespace tidy { diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp index 8c3a5c7..d81f156 100644 --- a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -14,6 +14,8 @@ using namespace clang::ast_matchers; namespace clang { +namespace tidy { +namespace modernize { namespace { @@ -42,9 +44,6 @@ const char LambdaId[] = "lambda"; } // namespace -namespace tidy { -namespace modernize { - void RedundantVoidArgCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()), unless(isExternC())) diff --git a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp index abdcdf4..7fc9437 100644 --- a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp @@ -12,12 +12,12 @@ #include "../utils/FixItHintUtils.h" #include "../utils/TypeTraits.h" +using namespace clang::ast_matchers; + namespace clang { namespace tidy { namespace performance { -using namespace ::clang::ast_matchers; - ForRangeCopyCheck::ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), WarnOnAllAutoCopies(Options.get("WarnOnAllAutoCopies", 0)) {} diff --git a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp index 04dadfb..3fcfdba 100644 --- a/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/ImplicitCastInLoopCheck.cpp @@ -15,10 +15,9 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" -namespace clang { - -using namespace ast_matchers; +using namespace clang::ast_matchers; +namespace clang { namespace tidy { namespace performance { diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp index f412545..f9c7b01 100644 --- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace readability { namespace { @@ -415,5 +416,6 @@ void ImplicitBoolCastCheck::handleCastFromBool( } } +} // namespace readability } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h index a33b96d..e9fa480 100644 --- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h +++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolCastCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace readability { /// \brief Checks for use of implicit bool casts in expressions. /// @@ -41,6 +42,7 @@ private: bool AllowConditionalPointerCasts; }; +} // namespace readability } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp index 7c24d5b..78438cb 100644 --- a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp @@ -15,12 +15,12 @@ #include #include +using namespace clang::ast_matchers; + namespace clang { namespace tidy { namespace readability { -using namespace ast_matchers; - namespace { AST_MATCHER(FunctionDecl, hasOtherDeclarations) { diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp index a158c54..ecd173a 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp @@ -14,9 +14,11 @@ #include "RedundantStringCStrCheck.h" #include "clang/Lex/Lexer.h" -namespace clang { +using namespace clang::ast_matchers; -using namespace ast_matchers; +namespace clang { +namespace tidy { +namespace readability { namespace { @@ -67,9 +69,6 @@ formatDereference(const ast_matchers::MatchFinder::MatchResult &Result, } // end namespace -namespace tidy { -namespace readability { - void RedundantStringCStrCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { // Only register the matchers for C++; the functionality currently does not diff --git a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp index 8a1ca4c..175e34a 100644 --- a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp @@ -16,6 +16,7 @@ using namespace clang::ast_matchers; namespace clang { namespace tidy { +namespace readability { void UniqueptrDeleteReleaseCheck::registerMatchers(MatchFinder *Finder) { auto IsSusbstituted = qualType(anyOf( @@ -64,6 +65,7 @@ void UniqueptrDeleteReleaseCheck::check( " = nullptr"); } +} // namespace readability } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h index ac55c76..b38ee6c 100644 --- a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h +++ b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.h @@ -14,6 +14,7 @@ namespace clang { namespace tidy { +namespace readability { /// Flag statements of the form: delete .release() /// and replace them with: = nullptr @@ -28,6 +29,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; +} // namespace readability } // namespace tidy } // namespace clang