diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h --- a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace simple uses of std::bind with a lambda. /// @@ -34,8 +32,6 @@ private: bool PermissiveParameterList = false; }; -} // namespace modernize -} // namespace tidy -} // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOID_BIND_H + +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOID_BIND_H diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp @@ -28,9 +28,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -718,6 +716,4 @@ Stream.str()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.h b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.h --- a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Find C-style array types and recommend to use std::array<> / std::vector<>. /// @@ -30,8 +28,4 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDCARRAYSCHECK_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_AVOIDCARRAYSCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp @@ -38,9 +38,7 @@ } // namespace -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -66,6 +64,4 @@ ArrayType->getTypePtr()->isVariableArrayType() ? UseVector : UseArray); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.h b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.h @@ -13,9 +13,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class ConcatNestedNamespacesCheck : public ClangTidyCheck { public: @@ -36,8 +34,5 @@ NamespaceString concatNamespaces(); NamespaceContextVec Namespaces; }; -} // namespace modernize -} // namespace tidy -} // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_CONCATNESTEDNAMESPACESCHECK_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_CONCATNESTEDNAMESPACESCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp @@ -12,9 +12,7 @@ #include #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static bool locationsInSameFile(const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2) { @@ -105,6 +103,4 @@ Namespaces.clear(); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// This check replaces deprecated C library headers with their C++ STL /// alternatives. @@ -43,8 +41,4 @@ Preprocessor *ModuleExpanderPP) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp @@ -15,9 +15,7 @@ #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { class IncludeModernizePPCallbacks : public PPCallbacks { @@ -117,6 +115,5 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang + +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// This check warns the uses of the deprecated member types of ``std::ios_base`` /// and replaces those that have a non-deprecated equivalent. @@ -31,8 +29,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_DEPRECATEDIOSBASEALIASESCHECK_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_DEPRECATEDIOSBASEALIASESCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static constexpr std::array DeprecatedTypes = { "::std::ios_base::io_state", "::std::ios_base::open_mode", @@ -71,6 +69,4 @@ diag(IoStateLoc, "'std::ios_base::%0' is deprecated") << TypeName; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.h b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.h --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.h @@ -12,9 +12,7 @@ #include "../ClangTidyCheck.h" #include "LoopConvertUtils.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class LoopConvertCheck : public ClangTidyCheck { public: @@ -73,8 +71,4 @@ const VariableNamer::NamingStyle NamingStyle; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp @@ -26,9 +26,7 @@ using namespace clang::ast_matchers; using namespace llvm; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static const char LoopNameArray[] = "forLoopArray"; static const char LoopNameIterator[] = "forLoopIterator"; @@ -926,6 +924,5 @@ Finder.aliasFromForInit(), Loop, Descriptor); } -} // namespace modernize -} // namespace tidy -} // namespace clang + +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.h b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.h --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.h +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.h @@ -22,9 +22,7 @@ #include #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { enum LoopFixerKind { LFK_Array, LFK_Iterator, LFK_PseudoArray }; @@ -459,8 +457,6 @@ bool declarationExists(llvm::StringRef Symbol); }; -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_UTILS_H diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp @@ -26,9 +26,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Tracks a stack of parent statements during traversal. /// @@ -903,6 +901,4 @@ return DeclFinder.findUsages(SourceStmt); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.h b/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.h --- a/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.h @@ -11,9 +11,7 @@ #include "MakeSmartPtrCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace the pattern: /// \code @@ -35,8 +33,4 @@ SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SHARED_H +} // namespace clang::tidy::modernize#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SHARED_H diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { MakeSharedCheck::MakeSharedCheck(StringRef Name, ClangTidyContext *Context) : MakeSmartPtrCheck(Name, Context, "std::make_shared") {} @@ -29,6 +27,4 @@ qualType().bind(PointerType))))))))); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h --- a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h @@ -16,9 +16,7 @@ #include "llvm/ADT/StringRef.h" #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Base class for MakeSharedCheck and MakeUniqueCheck. class MakeSmartPtrCheck : public ClangTidyCheck { @@ -64,8 +62,5 @@ void insertHeader(DiagnosticBuilder &Diag, FileID FD); }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_SMART_PTR_H diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -439,6 +437,5 @@ /*IsAngled=*/MakeSmartPtrFunctionHeader == StdMemoryHeader); } -} // namespace modernize -} // namespace tidy -} // namespace clang + +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.h b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.h --- a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.h @@ -11,9 +11,7 @@ #include "MakeSmartPtrCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace the pattern: /// \code @@ -37,8 +35,5 @@ const bool RequireCPlusPlus14; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_MAKE_UNIQUE_H diff --git a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { MakeUniqueCheck::MakeUniqueCheck(StringRef Name, clang::tidy::ClangTidyContext *Context) @@ -43,6 +41,5 @@ // FixItHint is done by MakeSmartPtrCheck -} // namespace modernize -} // namespace tidy -} // namespace clang + +} // namespace clang::tidy::modernize \ No newline at end of file diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp --- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp @@ -43,9 +43,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class ModernizeModule : public ClangTidyModule { public: @@ -122,11 +120,9 @@ static ClangTidyModuleRegistry::Add X("modernize-module", "Add modernize checks."); -} // namespace modernize - -// This anchor is used to force the linker to link in the generated object file +} // namespace clang::tidy::modernize// This anchor is used to force the linker to link in the generated object file // and thus register the ModernizeModule. volatile int ModernizeModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang + + diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.h b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.h --- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.h @@ -14,9 +14,7 @@ #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class PassByValueCheck : public ClangTidyCheck { public: @@ -36,8 +34,5 @@ const bool ValuesOnly; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_PASS_BY_VALUE_H diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; using namespace llvm; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { /// Matches move-constructible classes. @@ -224,6 +222,4 @@ /*IsAngled=*/true); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h --- a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.h @@ -12,9 +12,7 @@ #include "../ClangTidyCheck.h" #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { using CharsBitSet = std::bitset<1 << CHAR_BIT>; @@ -44,8 +42,5 @@ const bool ReplaceShorterLiterals; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RAW_STRING_LITERAL_H diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -147,6 +145,4 @@ << FixItHint::CreateReplacement(CharRange, Replacement); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.h b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.h --- a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.h @@ -14,9 +14,7 @@ #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Find and remove redundant void argument lists. /// @@ -73,8 +71,5 @@ void removeVoidToken(Token VoidToken, StringRef Diagnostic); }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REDUNDANT_VOID_ARG_CHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -245,6 +243,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.h @@ -12,7 +12,7 @@ #include "../ClangTidyCheck.h" #include "../utils/IncludeInserter.h" -namespace clang { +namespace clang::tidy::modernize { namespace tidy { namespace modernize { @@ -57,8 +57,5 @@ const utils::IncludeSorter::IncludeStyle IncludeStyle; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_AUTO_PTR_H diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp @@ -16,9 +16,7 @@ using namespace clang; using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { static const char AutoPtrTokenId[] = "AutoPrTokenId"; @@ -189,6 +187,4 @@ "unique_ptr"); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// This check finds macro expansions of ``DISALLOW_COPY_AND_ASSIGN(Type)`` and /// replaces them with a deleted copy constructor and a deleted assignment @@ -55,8 +53,5 @@ const std::string MacroName; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACEDISALLOWCOPYANDASSIGNMACROCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp @@ -11,9 +11,7 @@ #include "clang/Lex/MacroArgs.h" #include "llvm/Support/FormatVariadic.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -85,6 +83,4 @@ Options.store(Opts, "MacroName", MacroName); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.h b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.h @@ -12,9 +12,7 @@ #include "../ClangTidyCheck.h" #include "../utils/IncludeInserter.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// std::random_shuffle will be removed as of C++17. This check will find and /// replace all occurrences of std::random_shuffle with std::shuffle. @@ -38,8 +36,5 @@ const utils::IncludeSorter::IncludeStyle IncludeStyle; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_REPLACE_RANDOM_SHUFFLE_H diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { ReplaceRandomShuffleCheck::ReplaceRandomShuffleCheck(StringRef Name, ClangTidyContext *Context) @@ -100,6 +98,4 @@ "random", /*IsAngled=*/true); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.h b/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Use a braced init list for return statements rather than unnecessary /// repeating the return type name. @@ -31,8 +29,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_RETURN_BRACED_INIT_LIST_H diff --git a/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void ReturnBracedInitListCheck::registerMatchers(MatchFinder *Finder) { // Skip list initialization and constructors with an initializer list. @@ -89,6 +87,4 @@ << FixItHint::CreateReplacement(CallParensRange.getEnd(), "}"); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.h b/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.h --- a/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace copy and swap tricks on shrinkable containers with the /// `shrink_to_fit()` method call. @@ -32,8 +30,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_SHRINKTOFITCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void ShrinkToFitCheck::registerMatchers(MatchFinder *Finder) { // Swap as a function need not to be considered, because rvalue can not @@ -82,6 +80,4 @@ << Hint; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.h b/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replaces a static_assert declaration with an empty message /// with the unary version. @@ -31,8 +29,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_UNARY_STATIC_ASSERT_H diff --git a/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void UnaryStaticAssertCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(staticAssertDecl().bind("static_assert"), this); @@ -36,6 +34,4 @@ << FixItHint::CreateRemoval(AssertMessage->getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.h b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class UseAutoCheck : public ClangTidyCheck { public: @@ -35,8 +33,5 @@ const bool RemoveStars; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_AUTO_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { const char IteratorDeclStmtId[] = "iterator_decl"; @@ -494,6 +492,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.h b/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Finds integer literals which are cast to bool. /// @@ -33,8 +31,5 @@ const bool IgnoreMacros; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_BOOL_LITERALS_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { UseBoolLiteralsCheck::UseBoolLiteralsCheck(StringRef Name, ClangTidyContext *Context) @@ -74,6 +72,4 @@ Expression->getSourceRange(), LiteralBooleanValue ? "true" : "false"); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.h b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Convert a default constructor's member initializers into default member /// initializers. Remove member initializers that are the same as a default @@ -41,8 +39,5 @@ const bool IgnoreMacros; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_DEFAULT_MEMBER_INIT_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { AST_MATCHER_P(InitListExpr, initCountIs, unsigned, N) { @@ -295,6 +293,4 @@ << FixItHint::CreateRemoval(Init->getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h b/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.h @@ -13,9 +13,7 @@ #include #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// This check looks for cases when inserting new element into std::vector but /// the element is constructed temporarily. @@ -42,8 +40,5 @@ const std::vector TupleMakeFunctions; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EMPLACE_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp @@ -10,9 +10,7 @@ #include "../utils/OptionsUtils.h" using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { AST_MATCHER(DeclRefExpr, hasExplicitTemplateArgs) { @@ -171,6 +169,4 @@ utils::options::serializeStringList(TupleMakeFunctions)); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.h b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace default bodies of special member functions with '= default;'. /// \code @@ -48,8 +46,5 @@ const bool IgnoreMacros; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DEFAULT_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static const char SpecialFunction[] = "SpecialFunction"; @@ -324,6 +322,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.h b/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Mark unimplemented private special member functions with '= delete'. /// \code @@ -50,8 +48,5 @@ const bool IgnoreMacros; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_EQUALS_DELETE_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static const char SpecialFunction[] = "SpecialFunction"; static const char DeletedNotPublic[] = "DeletedNotPublic"; @@ -75,6 +73,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.h b/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Add ``[[nodiscard]]`` to non-void const-member functions with no /// arguments or pass-by-value or pass by const-reference arguments. @@ -43,8 +41,5 @@ const std::string NoDiscardMacro; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USENODISCARDCHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static bool doesNoDiscardMacroExist(ASTContext &Context, const llvm::StringRef &MacroId) { @@ -146,6 +144,4 @@ return LangOpts.CPlusPlus; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.h b/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Replace dynamic exception specifications, with /// `noexcept` (or user-defined macro) or `noexcept(false)`. @@ -44,8 +42,5 @@ const bool UseNoexceptFalse; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NOEXCEPT_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { AST_MATCHER(NamedDecl, isValid) { return !Node.isInvalidDecl(); } @@ -104,6 +102,4 @@ << ReplacementStr.empty() << ReplacementStr << FixIt; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { class UseNullptrCheck : public ClangTidyCheck { public: @@ -32,8 +30,5 @@ SmallVector NullMacros; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_NULLPTR_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; using namespace llvm; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { const char CastSequence[] = "sequence"; @@ -489,6 +487,4 @@ .TraverseStmt(const_cast(NullCast)); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.h b/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Use C++11's `override` and remove `virtual` where applicable. class UseOverrideCheck : public ClangTidyCheck { @@ -34,8 +32,5 @@ const std::string FinalSpelling; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USEOVERRIDECHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { UseOverrideCheck::UseOverrideCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -228,6 +226,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.h b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.h @@ -12,9 +12,7 @@ #include "../ClangTidy.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { struct ClassifiedToken { Token T; @@ -58,8 +56,5 @@ const SourceManager &SM, const LangOptions &LangOpts); }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USETRAILINGRETURNTYPECHECK_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { struct UnqualNameVisitor : public RecursiveASTVisitor { public: @@ -473,6 +471,4 @@ << FixItHint::CreateInsertion(InsertionLoc, " -> " + ReturnType); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.h b/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Prefer using transparent functors to non-transparent ones. /// @@ -32,8 +30,5 @@ const bool SafeMode; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_TRANSPARENT_FUNCTORS_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { UseTransparentFunctorsCheck::UseTransparentFunctorsCheck( StringRef Name, ClangTidyContext *Context) @@ -124,6 +122,4 @@ FunctorTypeLoc.getArgLoc(0).getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.h b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// This check will warn on calls to std::uncaught_exception and replace them with calls to /// std::uncaught_exceptions, since std::uncaught_exception was deprecated in C++17. In case of @@ -32,8 +30,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_UNCAUGHT_EXCEPTIONS_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void UseUncaughtExceptionsCheck::registerMatchers(MatchFinder *Finder) { std::string MatchText = "::std::uncaught_exception"; @@ -96,6 +94,4 @@ } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h --- a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h @@ -11,9 +11,7 @@ #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Check finds typedefs and replaces it with usings. /// @@ -37,8 +35,5 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace modernize -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::modernize #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USE_USING_H diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp --- a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { UseUsingCheck::UseUsingCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -115,6 +113,5 @@ std::string Replacement = Using + Name + " = " + Type; Diag << FixItHint::CreateReplacement(ReplaceRange, Replacement); } -} // namespace modernize -} // namespace tidy -} // namespace clang + +} // namespace clang::tidy::modernize diff --git a/clang/lib/Analysis/Consumed.cpp b/clang/lib/Analysis/Consumed.cpp --- a/clang/lib/Analysis/Consumed.cpp +++ b/clang/lib/Analysis/Consumed.cpp @@ -282,8 +282,7 @@ } // namespace -namespace clang { -namespace consumed { +namespace clang::consumed { enum EffectiveOp { EO_And, @@ -439,8 +438,7 @@ } }; -} // namespace consumed -} // namespace clang +} // namespace clang::consumed static void setStateForVarOrTmp(ConsumedStateMap *StateMap, const PropagationInfo &PInfo, @@ -453,8 +451,7 @@ StateMap->setState(PInfo.getTmp(), State); } -namespace clang { -namespace consumed { +namespace clang::consumed { class ConsumedStmtVisitor : public ConstStmtVisitor { using MapType = llvm::DenseMap; @@ -530,8 +527,7 @@ } }; -} // namespace consumed -} // namespace clang +} // namespace clang::consumed void ConsumedStmtVisitor::forwardInfo(const Expr *From, const Expr *To) { InfoEntry Entry = findInfo(From); diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp --- a/clang/lib/Analysis/ReachableCode.cpp +++ b/clang/lib/Analysis/ReachableCode.cpp @@ -667,7 +667,7 @@ // Reachability APIs. //===----------------------------------------------------------------------===// -namespace clang { namespace reachable_code { +namespace clang::reachable_code { void Callback::anchor() { } @@ -718,4 +718,4 @@ } } -}} // end namespace clang::reachable_code +}// end namespace clang::reachable_code diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -269,8 +269,7 @@ } // namespace -namespace clang { -namespace threadSafety { +namespace clang::threadSafety { class BeforeSet { private: @@ -306,9 +305,7 @@ BeforeMap BMap; CycleMap CycMap; }; - -} // namespace threadSafety -} // namespace clang +} // namespace clang::threadSafety namespace { diff --git a/clang/lib/Analysis/ThreadSafetyCommon.cpp b/clang/lib/Analysis/ThreadSafetyCommon.cpp --- a/clang/lib/Analysis/ThreadSafetyCommon.cpp +++ b/clang/lib/Analysis/ThreadSafetyCommon.cpp @@ -957,8 +957,7 @@ } // namespace -namespace clang { -namespace threadSafety { +namespace clang::threadSafety { void printSCFG(CFGWalker &Walker) { llvm::BumpPtrAllocator Bpa; @@ -968,6 +967,5 @@ TILPrinter::print(Scfg, llvm::errs()); } -} // namespace threadSafety -} // namespace clang +} // namespace clang::threadSafety */ diff --git a/clang/lib/Analysis/ThreadSafetyLogical.cpp b/clang/lib/Analysis/ThreadSafetyLogical.cpp --- a/clang/lib/Analysis/ThreadSafetyLogical.cpp +++ b/clang/lib/Analysis/ThreadSafetyLogical.cpp @@ -98,14 +98,10 @@ return cast(LHS)->expr() == cast(RHS)->expr(); } -namespace clang { -namespace threadSafety { -namespace lexpr { +namespace clang::threadSafety::lexpr { bool implies(const LExpr *LHS, const LExpr *RHS) { // Start out by assuming that LHS and RHS are not negated. return ::implies(LHS, false, RHS, false); } } -} -}