From 7d2ea6c422d3f5712b7253407005e1a465a76946 Mon Sep 17 00:00:00 2001 From: Carlos Galvez Date: Sat, 14 Jan 2023 17:40:54 +0000 Subject: [PATCH] [clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folder Fix applied by running: run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces Differential Revision: https://reviews.llvm.org/D141770 --- clang-tools-extra/clang-tidy/ClangTidy.cpp | 6 ++---- clang-tools-extra/clang-tidy/ClangTidyCheck.cpp | 6 ++---- .../clang-tidy/ClangTidyDiagnosticConsumer.cpp | 6 ++---- clang-tools-extra/clang-tidy/ClangTidyModule.cpp | 6 ++---- clang-tools-extra/clang-tidy/ClangTidyOptions.cpp | 12 ++++-------- clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp | 6 ++---- .../clang-tidy/ExpandModularHeadersPPCallbacks.cpp | 6 ++---- clang-tools-extra/clang-tidy/GlobList.cpp | 6 ++---- clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp | 6 ++---- clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp | 6 ++---- clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationAdditionCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationComparisonCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationConversionCastCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationDivisionCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationFactoryFloatCheck.cpp | 8 ++------ .../clang-tidy/abseil/DurationFactoryScaleCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp | 8 ++------ .../clang-tidy/abseil/DurationSubtractionCheck.cpp | 8 ++------ .../abseil/DurationUnnecessaryConversionCheck.cpp | 8 ++------ .../clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp | 8 ++------ .../clang-tidy/abseil/NoInternalDependenciesCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp | 8 ++------ .../clang-tidy/abseil/RedundantStrcatCallsCheck.cpp | 8 ++------ .../clang-tidy/abseil/StrCatAppendCheck.cpp | 8 ++------ .../clang-tidy/abseil/StringFindStartswithCheck.cpp | 8 ++------ .../clang-tidy/abseil/StringFindStrContainsCheck.cpp | 8 ++------ .../clang-tidy/abseil/TimeComparisonCheck.cpp | 8 ++------ .../clang-tidy/abseil/TimeSubtractionCheck.cpp | 8 ++------ .../abseil/UpgradeDurationConversionsCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/add_new_check.py | 16 ++++------------ clang-tools-extra/clang-tidy/altera/AlteraTidyModule.cpp | 6 ++---- .../clang-tidy/altera/IdDependentBackwardBranchCheck.cpp | 8 ++------ .../clang-tidy/altera/KernelNameRestrictionCheck.cpp | 8 ++------ .../clang-tidy/altera/SingleWorkItemBarrierCheck.cpp | 8 ++------ .../clang-tidy/altera/StructPackAlignCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp | 8 ++------ .../clang-tidy/android/AndroidTidyModule.cpp | 6 ++---- .../clang-tidy/android/CloexecAccept4Check.cpp | 8 ++------ .../clang-tidy/android/CloexecAcceptCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/android/CloexecCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecCreatCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/android/CloexecDupCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecEpollCreate1Check.cpp | 8 ++------ .../clang-tidy/android/CloexecEpollCreateCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecFopenCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecInotifyInit1Check.cpp | 8 ++------ .../clang-tidy/android/CloexecInotifyInitCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecMemfdCreateCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecOpenCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecPipe2Check.cpp | 8 ++------ .../clang-tidy/android/CloexecPipeCheck.cpp | 8 ++------ .../clang-tidy/android/CloexecSocketCheck.cpp | 8 ++------ .../android/ComparisonInTempFailureRetryCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp | 6 ++---- clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp | 8 ++------ .../clang-tidy/bugprone/ArgumentCommentCheck.cpp | 8 ++------ .../clang-tidy/bugprone/AssertSideEffectCheck.cpp | 8 ++------ .../clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp | 8 ++------ .../clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp | 8 ++------ .../bugprone/BoolPointerImplicitConversionCheck.cpp | 8 ++------ .../clang-tidy/bugprone/BranchCloneCheck.cpp | 8 ++------ .../clang-tidy/bugprone/BugproneTidyModule.cpp | 6 ++---- .../clang-tidy/bugprone/CopyConstructorInitCheck.cpp | 8 ++------ .../clang-tidy/bugprone/DanglingHandleCheck.cpp | 8 ++------ .../bugprone/DynamicStaticInitializersCheck.cpp | 8 ++------ .../bugprone/EasilySwappableParametersCheck.cpp | 8 ++------ .../clang-tidy/bugprone/ExceptionEscapeCheck.cpp | 6 ++---- .../clang-tidy/bugprone/FoldInitTypeCheck.cpp | 8 ++------ .../bugprone/ForwardDeclarationNamespaceCheck.cpp | 8 ++------ .../bugprone/ForwardingReferenceOverloadCheck.cpp | 8 ++------ .../ImplicitWideningOfMultiplicationResultCheck.cpp | 8 ++------ .../clang-tidy/bugprone/InaccurateEraseCheck.cpp | 8 ++------ .../clang-tidy/bugprone/IncorrectRoundingsCheck.cpp | 8 ++------ .../clang-tidy/bugprone/InfiniteLoopCheck.cpp | 6 ++---- .../clang-tidy/bugprone/IntegerDivisionCheck.cpp | 8 ++------ .../clang-tidy/bugprone/LambdaFunctionNameCheck.cpp | 8 ++------ .../clang-tidy/bugprone/MacroParenthesesCheck.cpp | 8 ++------ .../bugprone/MacroRepeatedSideEffectsCheck.cpp | 8 ++------ .../bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp | 8 ++------ .../bugprone/MisplacedPointerArithmeticInAllocCheck.cpp | 8 ++------ .../clang-tidy/bugprone/MisplacedWideningCastCheck.cpp | 8 ++------ .../clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp | 8 ++------ .../clang-tidy/bugprone/MultipleStatementMacroCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp | 8 ++------ .../clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp | 8 ++------ .../clang-tidy/bugprone/ParentVirtualCallCheck.cpp | 8 ++------ .../clang-tidy/bugprone/PosixReturnCheck.cpp | 8 ++------ .../bugprone/RedundantBranchConditionCheck.cpp | 8 ++------ .../clang-tidy/bugprone/ReservedIdentifierCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SharedPtrArrayMismatchCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SignalHandlerCheck.cpp | 6 ++---- .../clang-tidy/bugprone/SignedCharMisuseCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SizeofContainerCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SizeofExpressionCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SmartPtrArrayMismatchCheck.cpp | 8 ++------ .../bugprone/SpuriouslyWakeUpFunctionsCheck.cpp | 8 ++------ .../clang-tidy/bugprone/StandaloneEmptyCheck.cpp | 8 ++------ .../clang-tidy/bugprone/StringConstructorCheck.cpp | 8 ++------ .../clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp | 8 ++------ .../bugprone/StringLiteralWithEmbeddedNulCheck.cpp | 8 ++------ .../clang-tidy/bugprone/StringviewNullptrCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousIncludeCheck.cpp | 8 ++------ .../bugprone/SuspiciousMemoryComparisonCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp | 8 ++------ .../clang-tidy/bugprone/SwappedArgumentsCheck.cpp | 8 ++------ .../clang-tidy/bugprone/TerminatingContinueCheck.cpp | 8 ++------ .../clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp | 8 ++------ .../clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp | 8 ++------ .../bugprone/UndefinedMemoryManipulationCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UndelegatedConstructorCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UnhandledExceptionAtNewCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UnusedRaiiCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UnusedReturnValueCheck.cpp | 8 ++------ .../clang-tidy/bugprone/UseAfterMoveCheck.cpp | 9 ++------- .../clang-tidy/bugprone/VirtualNearMissCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp | 6 ++---- .../clang-tidy/cert/CommandProcessorCheck.cpp | 8 ++------ .../clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp | 8 ++------ .../clang-tidy/cert/DontModifyStdNamespaceCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/cert/FloatLoopCounter.cpp | 8 ++------ .../clang-tidy/cert/LimitedRandomnessCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp | 8 ++------ .../cert/NonTrivialTypesLibcMemoryCallsCheck.cpp | 8 ++------ .../clang-tidy/cert/PostfixOperatorCheck.cpp | 8 ++------ .../cert/ProperlySeededRandomGeneratorCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp | 8 ++------ .../clang-tidy/cert/StaticObjectExceptionCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp | 8 ++------ .../clang-tidy/cert/ThrownExceptionTypeCheck.cpp | 8 ++------ .../clang-tidy/cert/VariadicFunctionDefCheck.cpp | 8 ++------ .../clang-tidy/concurrency/ConcurrencyTidyModule.cpp | 6 ++---- .../clang-tidy/concurrency/MtUnsafeCheck.cpp | 6 ++---- .../concurrency/ThreadCanceltypeAsynchronousCheck.cpp | 8 ++------ .../AvoidConstOrRefDataMembersCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp | 8 ++------ .../AvoidNonConstGlobalVariablesCheck.cpp | 8 ++------ .../AvoidReferenceCoroutineParametersCheck.cpp | 8 ++------ .../cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | 6 ++---- .../clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp | 8 ++------ .../cppcoreguidelines/InterfacesGlobalInitCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp | 8 ++------ .../cppcoreguidelines/NarrowingConversionsCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/NoMallocCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp | 8 ++------ .../cppcoreguidelines/PreferMemberInitializerCheck.cpp | 8 ++------ .../ProBoundsArrayToPointerDecayCheck.cpp | 8 ++------ .../ProBoundsConstantArrayIndexCheck.cpp | 8 ++------ .../ProBoundsPointerArithmeticCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeConstCastCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeCstyleCastCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeMemberInitCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeReinterpretCastCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp | 8 ++------ .../cppcoreguidelines/ProTypeUnionAccessCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp | 8 ++------ .../clang-tidy/cppcoreguidelines/SlicingCheck.cpp | 8 ++------ .../cppcoreguidelines/SpecialMemberFunctionsCheck.cpp | 8 ++------ .../cppcoreguidelines/VirtualClassDestructorCheck.cpp | 8 ++------ .../clang-tidy/darwin/AvoidSpinlockCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp | 6 ++---- .../clang-tidy/darwin/DispatchOnceNonstaticCheck.cpp | 8 ++------ .../clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp | 8 ++------ .../fuchsia/DefaultArgumentsDeclarationsCheck.cpp | 8 ++------ .../clang-tidy/fuchsia/FuchsiaTidyModule.cpp | 6 ++---- .../clang-tidy/fuchsia/MultipleInheritanceCheck.cpp | 8 ++------ .../clang-tidy/fuchsia/OverloadedOperatorCheck.cpp | 8 ++------ .../fuchsia/StaticallyConstructedObjectsCheck.cpp | 8 ++------ .../clang-tidy/fuchsia/TrailingReturnCheck.cpp | 8 ++------ .../clang-tidy/fuchsia/VirtualInheritanceCheck.cpp | 8 ++------ .../clang-tidy/google/AvoidCStyleCastsCheck.cpp | 10 ++-------- .../clang-tidy/google/AvoidNSObjectNewCheck.cpp | 10 ++-------- .../google/AvoidThrowingObjCExceptionCheck.cpp | 10 ++-------- .../google/AvoidUnderscoreInGoogletestNameCheck.cpp | 10 ++-------- .../clang-tidy/google/DefaultArgumentsCheck.cpp | 8 ++------ .../clang-tidy/google/ExplicitConstructorCheck.cpp | 8 ++------ .../clang-tidy/google/ExplicitMakePairCheck.cpp | 8 ++------ .../clang-tidy/google/FunctionNamingCheck.cpp | 10 ++-------- .../clang-tidy/google/GlobalNamesInHeadersCheck.cpp | 10 ++-------- .../clang-tidy/google/GlobalVariableDeclarationCheck.cpp | 10 ++-------- clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp | 6 ++---- .../clang-tidy/google/IntegerTypesCheck.cpp | 8 ++------ .../clang-tidy/google/OverloadedUnaryAndCheck.cpp | 10 ++-------- clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp | 10 ++-------- .../clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp | 10 ++-------- .../clang-tidy/google/UpgradeGoogletestCaseCheck.cpp | 8 ++------ .../clang-tidy/google/UsingNamespaceDirectiveCheck.cpp | 10 ++-------- .../clang-tidy/hicpp/ExceptionBaseclassCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp | 6 ++---- .../clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp | 8 ++------ .../clang-tidy/hicpp/SignedBitwiseCheck.cpp | 8 ++------ .../clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp | 6 ++---- .../clang-tidy/linuxkernel/MustCheckErrsCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp | 6 ++---- .../llvm/PreferIsaOrDynCastInConditionalsCheck.cpp | 6 ++---- .../clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp | 8 ++------ .../clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp | 8 ++------ .../llvmlibc/ImplementationInNamespaceCheck.cpp | 8 ++------ .../clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp | 6 ++---- .../llvmlibc/RestrictSystemLibcHeadersCheck.cpp | 8 ++------ .../clang-tidy/misc/ConfusableIdentifierCheck.cpp | 8 ++------ .../clang-tidy/misc/ConstCorrectnessCheck.cpp | 8 ++------ .../clang-tidy/misc/DefinitionsInHeadersCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 6 ++---- .../clang-tidy/misc/MisleadingIdentifier.cpp | 8 ++------ .../clang-tidy/misc/MisplacedConstCheck.cpp | 8 ++------ .../clang-tidy/misc/NewDeleteOverloadsCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp | 9 ++------- .../misc/NonPrivateMemberVariablesInClassesCheck.cpp | 8 ++------ .../clang-tidy/misc/RedundantExpressionCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp | 8 ++------ .../misc/ThrowByValueCatchByReferenceCheck.cpp | 8 ++------ .../misc/UnconventionalAssignOperatorCheck.cpp | 8 ++------ .../clang-tidy/misc/UniqueptrResetReleaseCheck.cpp | 8 ++------ .../clang-tidy/misc/UnusedAliasDeclsCheck.cpp | 8 ++------ .../clang-tidy/misc/UnusedParametersCheck.cpp | 8 ++------ .../clang-tidy/misc/UnusedUsingDeclsCheck.cpp | 8 ++------ .../clang-tidy/misc/UseAnonymousNamespaceCheck.cpp | 8 ++------ .../clang-tidy/modernize/AvoidBindCheck.cpp | 8 ++------ .../clang-tidy/modernize/AvoidCArraysCheck.cpp | 8 ++------ .../clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp | 8 ++------ .../clang-tidy/modernize/DeprecatedHeadersCheck.cpp | 8 ++------ .../modernize/DeprecatedIosBaseAliasesCheck.cpp | 8 ++------ .../modernize/IntegralLiteralExpressionMatcher.cpp | 8 ++------ .../clang-tidy/modernize/LoopConvertCheck.cpp | 6 ++---- .../clang-tidy/modernize/LoopConvertUtils.cpp | 8 ++------ .../clang-tidy/modernize/MacroToEnumCheck.cpp | 8 ++------ .../clang-tidy/modernize/MakeSharedCheck.cpp | 8 ++------ .../clang-tidy/modernize/MakeSmartPtrCheck.cpp | 8 ++------ .../clang-tidy/modernize/MakeUniqueCheck.cpp | 8 ++------ .../clang-tidy/modernize/ModernizeTidyModule.cpp | 6 ++---- .../clang-tidy/modernize/PassByValueCheck.cpp | 8 ++------ .../clang-tidy/modernize/RawStringLiteralCheck.cpp | 8 ++------ .../clang-tidy/modernize/RedundantVoidArgCheck.cpp | 8 ++------ .../clang-tidy/modernize/ReplaceAutoPtrCheck.cpp | 8 ++------ .../modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp | 8 ++------ .../clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp | 8 ++------ .../clang-tidy/modernize/ReturnBracedInitListCheck.cpp | 8 ++------ .../clang-tidy/modernize/ShrinkToFitCheck.cpp | 8 ++------ .../clang-tidy/modernize/UnaryStaticAssertCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseBoolLiteralsCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseDefaultMemberInitCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseEmplaceCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseEqualsDefaultCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseEqualsDeleteCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseNodiscardCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseNoexceptCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseNullptrCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseOverrideCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseTransparentFunctorsCheck.cpp | 8 ++------ .../clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/mpi/MPITidyModule.cpp | 6 ++---- clang-tools-extra/clang-tidy/mpi/TypeMismatchCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/objc/AssertEquals.cpp | 8 ++------ .../clang-tidy/objc/AvoidNSErrorInitCheck.cpp | 8 ++------ .../clang-tidy/objc/DeallocInCategoryCheck.cpp | 8 ++------ .../clang-tidy/objc/ForbiddenSubclassingCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp | 8 ++------ .../clang-tidy/objc/NSDateFormatterCheck.cpp | 8 ++------ .../objc/NSInvocationArgumentLifetimeCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp | 6 ++---- .../clang-tidy/objc/PropertyDeclarationCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp | 8 ++------ .../clang-tidy/openmp/ExceptionEscapeCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp | 6 ++---- .../clang-tidy/openmp/UseDefaultNoneCheck.cpp | 8 ++------ .../clang-tidy/performance/FasterStringFindCheck.cpp | 8 ++------ .../clang-tidy/performance/ForRangeCopyCheck.cpp | 8 ++------ .../performance/ImplicitConversionInLoopCheck.cpp | 8 ++------ .../clang-tidy/performance/InefficientAlgorithmCheck.cpp | 8 ++------ .../performance/InefficientStringConcatenationCheck.cpp | 8 ++------ .../performance/InefficientVectorOperationCheck.cpp | 8 ++------ .../clang-tidy/performance/MoveConstArgCheck.cpp | 8 ++------ .../clang-tidy/performance/MoveConstructorInitCheck.cpp | 8 ++------ .../clang-tidy/performance/NoAutomaticMoveCheck.cpp | 8 ++------ .../clang-tidy/performance/NoIntToPtrCheck.cpp | 8 ++------ .../performance/NoexceptMoveConstructorCheck.cpp | 8 ++------ .../clang-tidy/performance/PerformanceTidyModule.cpp | 6 ++---- .../performance/TriviallyDestructibleCheck.cpp | 8 ++------ .../performance/TypePromotionInMathFnCheck.cpp | 8 ++------ .../performance/UnnecessaryCopyInitialization.cpp | 8 ++------ .../performance/UnnecessaryValueParamCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp | 6 ++---- .../clang-tidy/portability/PortabilityTidyModule.cpp | 6 ++---- .../portability/RestrictSystemIncludesCheck.cpp | 8 ++------ .../clang-tidy/portability/SIMDIntrinsicsCheck.cpp | 8 ++------ .../clang-tidy/portability/StdAllocatorConstCheck.cpp | 8 ++------ .../clang-tidy/readability/AvoidConstParamsInDecls.cpp | 8 ++------ .../readability/BracesAroundStatementsCheck.cpp | 8 ++------ .../clang-tidy/readability/ConstReturnTypeCheck.cpp | 8 ++------ .../clang-tidy/readability/ContainerContainsCheck.cpp | 8 ++------ .../clang-tidy/readability/ContainerDataPointerCheck.cpp | 8 ++------ .../clang-tidy/readability/ContainerSizeEmptyCheck.cpp | 6 ++---- .../readability/ConvertMemberFunctionsToStatic.cpp | 8 ++------ .../clang-tidy/readability/DeleteNullPointerCheck.cpp | 8 ++------ .../clang-tidy/readability/DuplicateIncludeCheck.cpp | 8 ++------ .../clang-tidy/readability/ElseAfterReturnCheck.cpp | 8 ++------ .../readability/FunctionCognitiveComplexityCheck.cpp | 8 ++------ .../clang-tidy/readability/FunctionSizeCheck.cpp | 8 ++------ .../clang-tidy/readability/IdentifierLengthCheck.cpp | 8 ++------ .../clang-tidy/readability/IdentifierNamingCheck.cpp | 6 ++---- .../readability/ImplicitBoolConversionCheck.cpp | 8 ++------ .../InconsistentDeclarationParameterNameCheck.cpp | 8 ++------ .../clang-tidy/readability/IsolateDeclarationCheck.cpp | 8 ++------ .../clang-tidy/readability/MagicNumbersCheck.cpp | 6 ++---- .../readability/MakeMemberFunctionConstCheck.cpp | 8 ++------ .../readability/MisleadingIndentationCheck.cpp | 8 ++------ .../clang-tidy/readability/MisplacedArrayIndexCheck.cpp | 8 ++------ .../clang-tidy/readability/NamedParameterCheck.cpp | 8 ++------ .../clang-tidy/readability/NamespaceCommentCheck.cpp | 8 ++------ .../clang-tidy/readability/NonConstParameterCheck.cpp | 8 ++------ .../clang-tidy/readability/QualifiedAutoCheck.cpp | 8 ++------ .../clang-tidy/readability/ReadabilityTidyModule.cpp | 6 ++---- .../readability/RedundantAccessSpecifiersCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantControlFlowCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantDeclarationCheck.cpp | 8 ++------ .../readability/RedundantFunctionPtrDereferenceCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantMemberInitCheck.cpp | 8 ++------ .../readability/RedundantPreprocessorCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantSmartptrGetCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantStringCStrCheck.cpp | 8 ++------ .../clang-tidy/readability/RedundantStringInitCheck.cpp | 8 ++------ .../clang-tidy/readability/SimplifyBooleanExprCheck.cpp | 8 ++------ .../readability/SimplifySubscriptExprCheck.cpp | 8 ++------ .../readability/StaticAccessedThroughInstanceCheck.cpp | 8 ++------ .../StaticDefinitionInAnonymousNamespaceCheck.cpp | 8 ++------ .../clang-tidy/readability/StringCompareCheck.cpp | 8 ++------ .../readability/SuspiciousCallArgumentCheck.cpp | 8 ++------ .../readability/UniqueptrDeleteReleaseCheck.cpp | 8 ++------ .../readability/UppercaseLiteralSuffixCheck.cpp | 8 ++------ .../clang-tidy/readability/UseAnyOfAllOfCheck.cpp | 6 ++---- clang-tools-extra/clang-tidy/rename_check.py | 5 +++-- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 6 ++---- clang-tools-extra/clang-tidy/utils/ASTUtils.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/Aliasing.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp | 10 ++-------- clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp | 9 ++------- clang-tools-extra/clang-tidy/utils/ExprSequence.cpp | 8 ++------ .../clang-tidy/utils/FileExtensionsUtils.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp | 10 ++-------- clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp | 6 ++---- clang-tools-extra/clang-tidy/utils/LexerUtils.cpp | 10 ++-------- clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp | 10 ++-------- .../clang-tidy/utils/RenamerClangTidyCheck.cpp | 6 ++---- .../clang-tidy/utils/TransformerClangTidyCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/utils/TypeTraits.cpp | 10 ++-------- clang-tools-extra/clang-tidy/utils/UsingInserter.cpp | 8 ++------ .../clang-tidy/zircon/TemporaryObjectsCheck.cpp | 8 ++------ clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp | 6 ++---- 369 files changed, 743 insertions(+), 2161 deletions(-) diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index 4007363..7382bf4 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -55,8 +55,7 @@ using namespace llvm; LLVM_INSTANTIATE_REGISTRY(clang::tidy::ClangTidyModuleRegistry) -namespace clang { -namespace tidy { +namespace clang::tidy { namespace { #if CLANG_TIDY_ENABLE_STATIC_ANALYZER @@ -658,5 +657,4 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) { return Result; } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp index 498140e..18169de 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp @@ -13,8 +13,7 @@ #include "llvm/Support/YAMLParser.h" #include -namespace clang { -namespace tidy { +namespace clang::tidy { ClangTidyCheck::ClangTidyCheck(StringRef CheckName, ClangTidyContext *Context) : CheckName(CheckName), Context(Context), @@ -225,5 +224,4 @@ ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName, StringRef Default) const { return getLocalOrGlobal(LocalName).value_or(Default); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp index 558190e..11ee7a0 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp @@ -319,8 +319,7 @@ void ClangTidyDiagnosticConsumer::finalizeLastError() { LastErrorPassesLineFilter = false; } -namespace clang { -namespace tidy { +namespace clang::tidy { const llvm::StringMap * getFixIt(const tooling::Diagnostic &Diagnostic, bool GetFixFromNotes) { @@ -340,8 +339,7 @@ getFixIt(const tooling::Diagnostic &Diagnostic, bool GetFixFromNotes) { return Result; } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy void ClangTidyDiagnosticConsumer::HandleDiagnostic( DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) { diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp index 6736643..8650e46 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyModule.cpp @@ -13,8 +13,7 @@ #include "ClangTidyModule.h" #include "ClangTidyCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { void ClangTidyCheckFactories::registerCheckFactory(StringRef Name, CheckFactory Factory) { @@ -51,5 +50,4 @@ ClangTidyOptions ClangTidyModule::getModuleOptions() { return ClangTidyOptions(); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp index 7d26e34..808929b 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp @@ -28,8 +28,7 @@ using OptionsSource = clang::tidy::ClangTidyOptionsProvider::OptionsSource; LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter) LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FileFilter::LineRange) -namespace llvm { -namespace yaml { +namespace llvm::yaml { // Map std::pair to a JSON array of size 2. template <> struct SequenceTraits { @@ -135,11 +134,9 @@ template <> struct MappingTraits { } }; -} // namespace yaml -} // namespace llvm +} // namespace llvm::yaml -namespace clang { -namespace tidy { +namespace clang::tidy { ClangTidyOptions ClangTidyOptions::getDefaults() { ClangTidyOptions Options; @@ -452,5 +449,4 @@ std::string configurationAsText(const ClangTidyOptions &Options) { return Stream.str(); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp b/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp index 3a03dc0..14dfe96 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp @@ -17,8 +17,7 @@ #define DEBUG_TYPE "clang-tidy-profiling" -namespace clang { -namespace tidy { +namespace clang::tidy { ClangTidyProfiling::StorageParams::StorageParams(llvm::StringRef ProfilePrefix, llvm::StringRef SourceFile) @@ -87,5 +86,4 @@ ClangTidyProfiling::~ClangTidyProfiling() { storeProfileData(); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp index 32465a4..a20fe23 100644 --- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp +++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp @@ -16,8 +16,7 @@ #define DEBUG_TYPE "clang-tidy" -namespace clang { -namespace tooling { +namespace clang::tooling { class ExpandModularHeadersPPCallbacks::FileRecorder { public: @@ -306,5 +305,4 @@ void ExpandModularHeadersPPCallbacks::Endif(SourceLocation Loc, parseToLocation(Loc); } -} // namespace tooling -} // namespace clang +} // namespace clang::tooling diff --git a/clang-tools-extra/clang-tidy/GlobList.cpp b/clang-tools-extra/clang-tidy/GlobList.cpp index 15d856e..acd08dd 100644 --- a/clang-tools-extra/clang-tidy/GlobList.cpp +++ b/clang-tools-extra/clang-tidy/GlobList.cpp @@ -10,8 +10,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" -namespace clang { -namespace tidy { +namespace clang::tidy { // Returns true if GlobList starts with the negative indicator ('-'), removes it // from the GlobList. @@ -73,5 +72,4 @@ bool CachedGlobList::contains(StringRef S) const { return Value; } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp b/clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp index 9f4b756..45d00dc 100644 --- a/clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp +++ b/clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp @@ -33,8 +33,7 @@ #include #include -namespace clang { -namespace tidy { +namespace clang::tidy { //===----------------------------------------------------------------------===// // NoLintType @@ -411,5 +410,4 @@ bool NoLintDirectiveHandler::shouldSuppress( EnableNoLintBlocks); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp b/clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp index 5d99e6b..09a09e6 100644 --- a/clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp @@ -29,8 +29,7 @@ #include "TimeSubtractionCheck.h" #include "UpgradeDurationConversionsCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace abseil { class AbseilModule : public ClangTidyModule { @@ -85,5 +84,4 @@ static ClangTidyModuleRegistry::Add X("abseil-module", // and thus register the AbseilModule. volatile int AbseilModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp b/clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp index e6617fb..06f98c7 100644 --- a/clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp @@ -19,9 +19,7 @@ using namespace ::clang::ast_matchers; using namespace ::clang::transformer; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { RewriteRuleWith CleanupCtadCheckImpl() { auto warning_message = cat("prefer absl::Cleanup's class template argument " @@ -42,6 +40,4 @@ RewriteRuleWith CleanupCtadCheckImpl() { CleanupCtadCheck::CleanupCtadCheck(StringRef Name, ClangTidyContext *Context) : utils::TransformerClangTidyCheck(CleanupCtadCheckImpl(), Name, Context) {} -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp index edf6a17..2a31d60 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void DurationAdditionCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -69,6 +67,4 @@ void DurationAdditionCheck::check(const MatchFinder::MatchResult &Result) { diag(Binop->getBeginLoc(), "perform addition in the duration domain") << Hint; } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp index 859aad7..59b4a52 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void DurationComparisonCheck::registerMatchers(MatchFinder *Finder) { auto Matcher = expr(comparisonOperatorWithCallee(functionDecl( @@ -55,6 +53,4 @@ void DurationComparisonCheck::check(const MatchFinder::MatchResult &Result) { .str()); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp index 328f6f1..869a0ec 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void DurationConversionCastCheck::registerMatchers(MatchFinder *Finder) { auto CallMatcher = ignoringImpCasts(callExpr( @@ -81,6 +79,4 @@ void DurationConversionCastCheck::check( } } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp index 0fb750c..50e2d03 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp @@ -11,9 +11,7 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Lex/Lexer.h" -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { using namespace clang::ast_matchers; @@ -52,6 +50,4 @@ void DurationDivisionCheck::check(const MatchFinder::MatchResult &Result) { ")"); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationFactoryFloatCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationFactoryFloatCheck.cpp index fcb4a85..6cb687d 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationFactoryFloatCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationFactoryFloatCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { // Returns `true` if `Range` is inside a macro definition. static bool insideMacroDefinition(const MatchFinder::MatchResult &Result, @@ -66,6 +64,4 @@ void DurationFactoryFloatCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp index 24b3f56..5688dc1 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { // Given the name of a duration factory function, return the appropriate // `DurationScale` for that factory. If no factory can be found for @@ -224,6 +222,4 @@ void DurationFactoryScaleCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp index d96093f..2790a20 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { struct DurationScale2IndexFunctor { using argument_type = DurationScale; @@ -322,6 +320,4 @@ bool isInMacro(const MatchFinder::MatchResult &Result, const Expr *E) { return Loc.isMacroID(); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationSubtractionCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationSubtractionCheck.cpp index 21425b4..4860029 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationSubtractionCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationSubtractionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void DurationSubtractionCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -57,6 +55,4 @@ void DurationSubtractionCheck::check(const MatchFinder::MatchResult &Result) { .str()); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp b/clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp index b357d80..9bb1fd5 100644 --- a/clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void DurationUnnecessaryConversionCheck::registerMatchers(MatchFinder *Finder) { for (const auto &Scale : {"Hours", "Minutes", "Seconds", "Milliseconds", @@ -113,6 +111,4 @@ void DurationUnnecessaryConversionCheck::check( << Hint; } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp b/clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp index 02d96db..bda9b9e 100644 --- a/clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { namespace { @@ -125,6 +123,4 @@ void FasterStrsplitDelimiterCheck::check( *Replacement); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp b/clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp index ee0da4b..d04afa4 100644 --- a/clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void NoInternalDependenciesCheck::registerMatchers(MatchFinder *Finder) { // TODO: refactor matcher to be configurable or just match on any internal @@ -45,6 +43,4 @@ void NoInternalDependenciesCheck::check(const MatchFinder::MatchResult &Result) "details are reserved to Abseil"); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp index 4e7b093..ec011bd 100644 --- a/clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void NoNamespaceCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -33,6 +31,4 @@ void NoNamespaceCheck::check(const MatchFinder::MatchResult &Result) { "and should not be opened in user code"); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp b/clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp index 15171be..2eed10b 100644 --- a/clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { // TODO: Features to add to the check: // - Make it work if num_args > 26. @@ -134,6 +132,4 @@ void RedundantStrcatCallsCheck::check(const MatchFinder::MatchResult& Result) { << CheckResult.Hints; } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp b/clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp index a2586be..ab6ed70 100644 --- a/clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { namespace { // Skips any combination of temporary materialization, temporary binding and @@ -97,6 +95,4 @@ void StrCatAppendCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateInsertion(Call->getArg(0)->getBeginLoc(), "&"); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp b/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp index 19e6897..7effb82 100644 --- a/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { StringFindStartswithCheck::StringFindStartswithCheck(StringRef Name, ClangTidyContext *Context) @@ -142,6 +140,4 @@ void StringFindStartswithCheck::storeOptions( Options.store(Opts, "AbseilStringsMatchHeader", AbseilStringsMatchHeader); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp b/clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp index b3bc382..28b2f81 100644 --- a/clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp @@ -20,9 +20,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { using ::clang::transformer::addInclude; using ::clang::transformer::applyFirst; @@ -107,6 +105,4 @@ void StringFindStrContainsCheck::storeOptions( AbseilStringsMatchHeaderOption); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/TimeComparisonCheck.cpp b/clang-tools-extra/clang-tidy/abseil/TimeComparisonCheck.cpp index fa6fcd8..d105786 100644 --- a/clang-tools-extra/clang-tidy/abseil/TimeComparisonCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/TimeComparisonCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void TimeComparisonCheck::registerMatchers(MatchFinder *Finder) { auto Matcher = @@ -57,6 +55,4 @@ void TimeComparisonCheck::check(const MatchFinder::MatchResult &Result) { .str()); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp b/clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp index 7e8a94e..a2171aa 100644 --- a/clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { // Returns `true` if `Range` is inside a macro definition. static bool insideMacroDefinition(const MatchFinder::MatchResult &Result, @@ -197,6 +195,4 @@ void TimeSubtractionCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp b/clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp index 539b575..8e27e8e 100644 --- a/clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace abseil { +namespace clang::tidy::abseil { void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) { // For the arithmetic calls, we match only the uses of the templated operators @@ -160,6 +158,4 @@ void UpgradeDurationConversionsCheck::check( << FixItHint::CreateInsertion(SourceRange.getEnd(), ")"); } -} // namespace abseil -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::abseil diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py index e3ad7a2..8c5e140 100755 --- a/clang-tools-extra/clang-tidy/add_new_check.py +++ b/clang-tools-extra/clang-tidy/add_new_check.py @@ -77,9 +77,7 @@ def write_header(module_path, module, namespace, check_name, check_name_camel): #include "../ClangTidyCheck.h" -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { /// FIXME: Write a short description. /// @@ -93,9 +91,7 @@ public: void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s #endif // %(header_guard)s """ % {'header_guard': header_guard, @@ -129,9 +125,7 @@ def write_implementation(module_path, module, namespace, check_name_camel): using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace %(namespace)s { +namespace clang::tidy::%(namespace)s { void %(check_name)s::registerMatchers(MatchFinder *Finder) { // FIXME: Add matchers. @@ -149,9 +143,7 @@ void %(check_name)s::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_"); } -} // namespace %(namespace)s -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::%(namespace)s """ % {'check_name': check_name_camel, 'module': module, 'namespace': namespace}) diff --git a/clang-tools-extra/clang-tidy/altera/AlteraTidyModule.cpp b/clang-tools-extra/clang-tidy/altera/AlteraTidyModule.cpp index 1745877..21610c7 100644 --- a/clang-tools-extra/clang-tidy/altera/AlteraTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/altera/AlteraTidyModule.cpp @@ -17,8 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace altera { class AlteraModule : public ClangTidyModule { @@ -46,5 +45,4 @@ static ClangTidyModuleRegistry::Add // and thus register the AlteraModule. volatile int AlteraModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp b/clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp index 09cddb2..66e6d97 100644 --- a/clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp +++ b/clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace altera { +namespace clang::tidy::altera { void IdDependentBackwardBranchCheck::registerMatchers(MatchFinder *Finder) { // Prototype to identify all variables which hold a thread-variant ID. @@ -259,6 +257,4 @@ void IdDependentBackwardBranchCheck::check( } } -} // namespace altera -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::altera diff --git a/clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp b/clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp index ddf09ca..f88b70b 100644 --- a/clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp +++ b/clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace altera { +namespace clang::tidy::altera { namespace { @@ -102,6 +100,4 @@ void KernelNameRestrictionPPCallbacks::EndOfMainFile() { } } -} // namespace altera -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::altera diff --git a/clang-tools-extra/clang-tidy/altera/SingleWorkItemBarrierCheck.cpp b/clang-tools-extra/clang-tidy/altera/SingleWorkItemBarrierCheck.cpp index 759c81c..a4e7cf48 100644 --- a/clang-tools-extra/clang-tidy/altera/SingleWorkItemBarrierCheck.cpp +++ b/clang-tools-extra/clang-tidy/altera/SingleWorkItemBarrierCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace altera { +namespace clang::tidy::altera { void SingleWorkItemBarrierCheck::registerMatchers(MatchFinder *Finder) { // Find any function that calls barrier but does not call an ID function. @@ -79,6 +77,4 @@ void SingleWorkItemBarrierCheck::storeOptions( Options.store(Opts, "AOCVersion", AOCVersion); } -} // namespace altera -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::altera diff --git a/clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp b/clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp index b5f8d08..70a6ab3 100644 --- a/clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp +++ b/clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace altera { +namespace clang::tidy::altera { void StructPackAlignCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(recordDecl(isStruct(), isDefinition(), @@ -143,6 +141,4 @@ void StructPackAlignCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "MaxConfiguredAlignment", MaxConfiguredAlignment); } -} // namespace altera -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::altera diff --git a/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp b/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp index 75797c1..667c1b9 100644 --- a/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp +++ b/clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace altera { +namespace clang::tidy::altera { UnrollLoopsCheck::UnrollLoopsCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -267,6 +265,4 @@ void UnrollLoopsCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "MaxLoopIterations", MaxLoopIterations); } -} // namespace altera -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::altera diff --git a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp index b24c0d9..4541e92 100644 --- a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp @@ -27,8 +27,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace android { /// This module is for Android specific checks. @@ -69,5 +68,4 @@ static ClangTidyModuleRegistry::Add // and thus register the AndroidModule. volatile int AndroidModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/android/CloexecAccept4Check.cpp b/clang-tools-extra/clang-tidy/android/CloexecAccept4Check.cpp index fe1f341..77dca9b 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecAccept4Check.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecAccept4Check.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecAccept4Check::registerMatchers(MatchFinder *Finder) { auto SockAddrPointerType = @@ -34,6 +32,4 @@ void CloexecAccept4Check::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"SOCK_CLOEXEC", /*ArgPos=*/3); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp index b79c554..80be6fe 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecAcceptCheck::registerMatchers(MatchFinder *Finder) { auto SockAddrPointerType = @@ -41,6 +39,4 @@ void CloexecAcceptCheck::check(const MatchFinder::MatchResult &Result) { ReplacementText); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp index d373877..39a0d74 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { namespace { // Helper function to form the correct string mode for Type3. @@ -108,6 +106,4 @@ StringRef CloexecCheck::getSpellingArg(const MatchFinder::MatchResult &Result, SM, Result.Context->getLangOpts()); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp index f096884..514f11f 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecCreatCheck::registerMatchers(MatchFinder *Finder) { auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter()))); @@ -37,6 +35,4 @@ void CloexecCreatCheck::check(const MatchFinder::MatchResult &Result) { ReplacementText); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecDupCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecDupCheck.cpp index 1f068d4..fad7bbd 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecDupCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecDupCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecDupCheck::registerMatchers(MatchFinder *Finder) { registerMatchersImpl(Finder, @@ -32,6 +30,4 @@ void CloexecDupCheck::check(const MatchFinder::MatchResult &Result) { ReplacementText); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecEpollCreate1Check.cpp b/clang-tools-extra/clang-tidy/android/CloexecEpollCreate1Check.cpp index 8fb175e..1c5919c 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecEpollCreate1Check.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecEpollCreate1Check.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecEpollCreate1Check::registerMatchers(MatchFinder *Finder) { registerMatchersImpl( @@ -27,6 +25,4 @@ void CloexecEpollCreate1Check::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"EPOLL_CLOEXEC", /*ArgPos=*/0); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecEpollCreateCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecEpollCreateCheck.cpp index f1d7edf..0a7fe30 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecEpollCreateCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecEpollCreateCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecEpollCreateCheck::registerMatchers(MatchFinder *Finder) { registerMatchersImpl( @@ -30,6 +28,4 @@ void CloexecEpollCreateCheck::check(const MatchFinder::MatchResult &Result) { "epoll_create1(EPOLL_CLOEXEC)"); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp index dc9908b..ab16598 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecFopenCheck::registerMatchers(MatchFinder *Finder) { auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter()))); @@ -31,6 +29,4 @@ void CloexecFopenCheck::check(const MatchFinder::MatchResult &Result) { insertStringFlag(Result, /*Mode=*/'e', /*ArgPos=*/1); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecInotifyInit1Check.cpp b/clang-tools-extra/clang-tidy/android/CloexecInotifyInit1Check.cpp index f0a0b98..247b3e8 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecInotifyInit1Check.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecInotifyInit1Check.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecInotifyInit1Check::registerMatchers(MatchFinder *Finder) { registerMatchersImpl( @@ -27,6 +25,4 @@ void CloexecInotifyInit1Check::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"IN_CLOEXEC", /*ArgPos=*/0); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecInotifyInitCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecInotifyInitCheck.cpp index e11cbb8..0e26f9c 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecInotifyInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecInotifyInitCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecInotifyInitCheck::registerMatchers(MatchFinder *Finder) { registerMatchersImpl( @@ -28,6 +26,4 @@ void CloexecInotifyInitCheck::check(const MatchFinder::MatchResult &Result) { /*FixMsg=*/"inotify_init1(IN_CLOEXEC)"); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecMemfdCreateCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecMemfdCreateCheck.cpp index 6fa606b..4e53d60 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecMemfdCreateCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecMemfdCreateCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecMemfdCreateCheck::registerMatchers(MatchFinder *Finder) { auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter()))); @@ -26,6 +24,4 @@ void CloexecMemfdCreateCheck::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, "MFD_CLOEXEC", /*ArgPos=*/1); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp index d0617a3..8804bcb 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecOpenCheck::registerMatchers(MatchFinder *Finder) { auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter()))); @@ -38,6 +36,4 @@ void CloexecOpenCheck::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"O_CLOEXEC", ArgPos); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp b/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp index 7e3107d..773037d 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecPipe2Check::registerMatchers(MatchFinder *Finder) { registerMatchersImpl(Finder, @@ -28,6 +26,4 @@ void CloexecPipe2Check::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"O_CLOEXEC", /*ArgPos=*/1); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp index 94b9450..8aa0d8f 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecPipeCheck::registerMatchers(MatchFinder *Finder) { registerMatchersImpl(Finder, @@ -32,6 +30,4 @@ void CloexecPipeCheck::check(const MatchFinder::MatchResult &Result) { ReplacementText); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp index dd0f624..9e2e6ca 100644 --- a/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { void CloexecSocketCheck::registerMatchers(MatchFinder *Finder) { registerMatchersImpl(Finder, @@ -29,6 +27,4 @@ void CloexecSocketCheck::check(const MatchFinder::MatchResult &Result) { insertMacroFlag(Result, /*MacroFlag=*/"SOCK_CLOEXEC", /*ArgPos=*/1); } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp b/clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp index c7b9896..9ad56fb 100644 --- a/clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp +++ b/clang-tools-extra/clang-tidy/android/ComparisonInTempFailureRetryCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace android { +namespace clang::tidy::android { ComparisonInTempFailureRetryCheck::ComparisonInTempFailureRetryCheck( StringRef Name, ClangTidyContext *Context) @@ -90,6 +88,4 @@ void ComparisonInTempFailureRetryCheck::check( // happen, e.g. `TEMP_FAILURE_RETRY(IS_ZERO(foo()))` } -} // namespace android -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::android diff --git a/clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp b/clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp index 4ab22ad..4c5808d 100644 --- a/clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/boost/BoostTidyModule.cpp @@ -12,8 +12,7 @@ #include "UseToStringCheck.h" using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace boost { class BoostModule : public ClangTidyModule { @@ -33,5 +32,4 @@ static ClangTidyModuleRegistry::Add X("boost-module", // and thus register the BoostModule. volatile int BoostModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp b/clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp index 4e4a073..bcd5def 100644 --- a/clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp +++ b/clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace boost { +namespace clang::tidy::boost { namespace { AST_MATCHER(Type, isStrictlyInteger) { @@ -66,6 +64,4 @@ void UseToStringCheck::check(const MatchFinder::MatchResult &Result) { (llvm::Twine("std::to_") + StringType + "(").str()); } -} // namespace boost -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::boost diff --git a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp index 76b8cd6..2a367d7 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(Decl, isFromStdNamespaceOrSystemHeader) { if (const auto *D = Node.getDeclContext()->getEnclosingNamespaceContext()) @@ -368,6 +366,4 @@ void ArgumentCommentCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/AssertSideEffectCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/AssertSideEffectCheck.cpp index 74e08ed..600a923 100644 --- a/clang-tools-extra/clang-tidy/bugprone/AssertSideEffectCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/AssertSideEffectCheck.cpp @@ -21,9 +21,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -134,6 +132,4 @@ void AssertSideEffectCheck::check(const MatchFinder::MatchResult &Result) { << AssertMacroName; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp index 47a82e3..9e56ee6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void AssignmentInIfConditionCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(translationUnitDecl(), this); @@ -76,6 +74,4 @@ void AssignmentInIfConditionCheck::report(const Expr *AssignmentExpr) { DiagnosticIDs::Note); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp index 5b6da9a..e1baffd 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BadSignalToKillThreadCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void BadSignalToKillThreadCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -70,6 +68,4 @@ void BadSignalToKillThreadCheck::registerPPCallbacks( PP = Pp; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp index 8aae92e..09b198d 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BoolPointerImplicitConversionCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void BoolPointerImplicitConversionCheck::registerMatchers(MatchFinder *Finder) { // Look for ifs that have an implicit bool* to bool conversion in the @@ -84,6 +82,4 @@ void BoolPointerImplicitConversionCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp index 5bc35aa6..41b8d32 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp @@ -64,9 +64,7 @@ static bool areSwitchBranchesIdentical(const SwitchBranch LHS, return true; } -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void BranchCloneCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -238,6 +236,4 @@ void BranchCloneCheck::check(const MatchFinder::MatchResult &Result) { llvm_unreachable("No if statement and no switch statement."); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp index f2842a6..a11db60 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp @@ -76,8 +76,7 @@ #include "UseAfterMoveCheck.h" #include "VirtualNearMissCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace bugprone { class BugproneModule : public ClangTidyModule { @@ -220,5 +219,4 @@ static ClangTidyModuleRegistry::Add // and thus register the BugproneModule. volatile int BugproneModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.cpp index 5f0cbe0..6b26b46 100644 --- a/clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void CopyConstructorInitCheck::registerMatchers(MatchFinder *Finder) { // In the future this might be extended to move constructors? @@ -112,6 +110,4 @@ void CopyConstructorInitCheck::check(const MatchFinder::MatchResult &Result) { Diag << FixItHint::CreateInsertion(FixItLoc, FixItMsg); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp index 914430c..11299b9 100644 --- a/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -187,6 +185,4 @@ void DanglingHandleCheck::check(const MatchFinder::MatchResult &Result) { << Handle->getQualifiedNameAsString(); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp index 3084248..79731ad 100644 --- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { AST_MATCHER(clang::VarDecl, hasConstantDeclaration) { const Expr *Init = Node.getInit(); @@ -62,6 +60,4 @@ void DynamicStaticInitializersCheck::check(const MatchFinder::MatchResult &Resul << Var; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp index 2c525ec..0e21453 100644 --- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp @@ -89,9 +89,7 @@ static constexpr std::size_t using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { using TheCheck = EasilySwappableParametersCheck; @@ -2311,6 +2309,4 @@ void EasilySwappableParametersCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp index 85af540..276c46c 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp @@ -23,8 +23,7 @@ AST_MATCHER_P(FunctionDecl, isEnabled, llvm::StringSet<>, } } // namespace -namespace tidy { -namespace bugprone { +namespace tidy::bugprone { ExceptionEscapeCheck::ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), RawFunctionsThatShouldNotThrow(Options.get( @@ -77,6 +76,5 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { << MatchedDecl; } -} // namespace bugprone -} // namespace tidy +} // namespace tidy::bugprone } // namespace clang diff --git a/clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp index d3bcdb2..c7a3032 100644 --- a/clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void FoldInitTypeCheck::registerMatchers(MatchFinder *Finder) { // We match functions of interest and bind the iterator and init value types. @@ -134,6 +132,4 @@ void FoldInitTypeCheck::check(const MatchFinder::MatchResult &Result) { doCheck(*Iter2ValueType, *InitType, *Result.Context, *CallNode); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp index c98a1ab..ae87421 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void ForwardDeclarationNamespaceCheck::registerMatchers(MatchFinder *Finder) { // Match all class declarations/definitions *EXCEPT* @@ -168,6 +166,4 @@ void ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit() { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp index 107b11e..99cb120 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { // Check if the given type is related to std::enable_if. @@ -145,6 +143,4 @@ void ForwardingReferenceOverloadCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.cpp index e09092d..e27012a 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.cpp @@ -21,9 +21,7 @@ AST_MATCHER(ImplicitCastExpr, isPartOfExplicitCast) { } // namespace } // namespace clang -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static const Expr *getLHSOfMulBinOp(const Expr *E) { assert(E == E->IgnoreParens() && "Already skipped all parens!"); @@ -273,6 +271,4 @@ void ImplicitWideningOfMultiplicationResultCheck::check( handlePointerOffsetting(MatchedDecl); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp index 96fa7ef..164de76 100644 --- a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) { const auto EndCall = @@ -61,6 +59,4 @@ void InaccurateEraseCheck::check(const MatchFinder::MatchResult &Result) { << Hint; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp index 2f908e4..beca7aef 100644 --- a/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(FloatingLiteral, floatHalf) { @@ -66,6 +64,4 @@ void IncorrectRoundingsCheck::check(const MatchFinder::MatchResult &Result) { "consider using lround (#include ) instead"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp index 5d4b828..e329588 100644 --- a/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp @@ -31,8 +31,7 @@ AST_MATCHER(FunctionType, typeHasNoReturnAttr) { return Node.getNoReturnAttr(); } } // namespace ast_matchers -namespace tidy { -namespace bugprone { +namespace tidy::bugprone { static internal::Matcher loopEndingStmt(internal::Matcher Internal) { @@ -329,6 +328,5 @@ void InfiniteLoopCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy +} // namespace tidy::bugprone } // namespace clang diff --git a/clang-tools-extra/clang-tidy/bugprone/IntegerDivisionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/IntegerDivisionCheck.cpp index f68c2f8..92e0413 100644 --- a/clang-tools-extra/clang-tidy/bugprone/IntegerDivisionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/IntegerDivisionCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void IntegerDivisionCheck::registerMatchers(MatchFinder *Finder) { const auto IntType = hasType(isInteger()); @@ -49,6 +47,4 @@ void IntegerDivisionCheck::check(const MatchFinder::MatchResult &Result) { "point context; possible loss of precision"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp index ba6f6ba..2f15582 100644 --- a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -93,6 +91,4 @@ void LambdaFunctionNameCheck::check(const MatchFinder::MatchResult &Result) { << PredefinedExpr::getIdentKindName(E->getIdentKind()); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp index 303119d..7d89e10 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp @@ -11,9 +11,7 @@ #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { class MacroParenthesesPPCallbacks : public PPCallbacks { @@ -268,6 +266,4 @@ void MacroParenthesesCheck::registerPPCallbacks( PP->addPPCallbacks(std::make_unique(PP, this)); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp index dbda14c..a64c9b2 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MacroRepeatedSideEffectsCheck.cpp @@ -13,9 +13,7 @@ #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { class MacroRepeatedPPCallbacks : public PPCallbacks { @@ -175,6 +173,4 @@ void MacroRepeatedSideEffectsCheck::registerPPCallbacks( PP->addPPCallbacks(::std::make_unique(*this, *PP)); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp index beecfa6..40e4ab6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void MisplacedOperatorInStrlenInAllocCheck::registerMatchers( MatchFinder *Finder) { @@ -108,6 +106,4 @@ void MisplacedOperatorInStrlenInAllocCheck::check( << StrLen->getDirectCallee()->getName() << Hint; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp index 6208cb5..b9129fa 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void MisplacedPointerArithmeticInAllocCheck::registerMatchers( MatchFinder *Finder) { @@ -99,6 +97,4 @@ void MisplacedPointerArithmeticInAllocCheck::check( << FixItHint::CreateInsertion(NewRParen, RParen); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp index 65fa31e..bdf388f 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedWideningCastCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { MisplacedWideningCastCheck::MisplacedWideningCastCheck( StringRef Name, ClangTidyContext *Context) @@ -226,6 +224,4 @@ void MisplacedWideningCastCheck::check(const MatchFinder::MatchResult &Result) { << CalcType << CastType; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp index f4ff4a9..96cd1ea 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static void replaceMoveWithForward(const UnresolvedLookupExpr *Callee, const ParmVarDecl *ParmVar, @@ -124,6 +122,4 @@ void MoveForwardingReferenceCheck::check( *Result.Context); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp index e57feaf..de05cc0 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MultipleStatementMacroCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -101,6 +99,4 @@ void MultipleStatementMacroCheck::check( "unconditionally executed"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp index 654e80d..8023e32 100644 --- a/clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void NoEscapeCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(callExpr(callee(functionDecl(hasName("::dispatch_async"))), @@ -46,6 +44,4 @@ void NoEscapeCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp index 35f12d2..c0c180f 100644 --- a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { constexpr llvm::StringLiteral FunctionExprName = "FunctionExpr"; constexpr llvm::StringLiteral CastExprName = "CastExpr"; @@ -1010,6 +1008,4 @@ void NotNullTerminatedResultCheck::xfrmFix( lengthArgHandle(LengthHandleKind::Increase, Result, Diag); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ParentVirtualCallCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ParentVirtualCallCheck.cpp index 02e7ca1..5520349 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ParentVirtualCallCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ParentVirtualCallCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { using BasesVector = llvm::SmallVector; @@ -147,6 +145,4 @@ void ParentVirtualCallCheck::check(const MatchFinder::MatchResult &Result) { getNameAsString(Parents.front()) + "::"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/PosixReturnCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/PosixReturnCheck.cpp index 586940f..378427a 100644 --- a/clang-tools-extra/clang-tidy/bugprone/PosixReturnCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/PosixReturnCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static StringRef getFunctionSpelling(const MatchFinder::MatchResult &Result, const char *BindingStr) { @@ -82,6 +80,4 @@ void PosixReturnCheck::check(const MatchFinder::MatchResult &Result) { << getFunctionSpelling(Result, "binop"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp index 3998e2b..3e04df6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; using clang::tidy::utils::hasPtrOrReferenceInFunc; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static const char CondVarStr[] = "cond_var"; static const char OuterIfStr[] = "outer_if"; @@ -177,6 +175,4 @@ void RedundantBranchConditionCheck::check(const MatchFinder::MatchResult &Result } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp index c6409c0..7ecbf74 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp @@ -20,9 +20,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static const char DoubleUnderscoreTag[] = "du"; static const char UnderscoreCapitalTag[] = "uc"; @@ -180,6 +178,4 @@ ReservedIdentifierCheck::getDiagInfo(const NamingCheckId &ID, }}; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.cpp index b628ebd..72036aa 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SharedPtrArrayMismatchCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { SharedPtrArrayMismatchCheck::SharedPtrArrayMismatchCheck( StringRef Name, ClangTidyContext *Context) @@ -26,6 +24,4 @@ SharedPtrArrayMismatchCheck::getSmartPointerClassMatcher() const { 0, templateArgument(refersToType(qualType().bind(PointerTypeN))))); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp index b1684d3..a0b2afd 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp @@ -219,8 +219,7 @@ constexpr llvm::StringLiteral POSIXConformingFunctions[] = { using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { template <> struct OptionEnumMapping< @@ -560,5 +559,4 @@ void SignalHandlerCheck::reportHandlerChain( } } // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp index ed64429..ea3b8b8 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static constexpr int UnsignedASCIIUpperBound = 127; @@ -168,6 +166,4 @@ void SignedCharMisuseCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp index d7e6941..ff8b149 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -43,6 +41,4 @@ void SizeofContainerCheck::check(const MatchFinder::MatchResult &Result) { "container; did you mean .size()?"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp index 57086af..62cde11 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -360,6 +358,4 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.cpp index 4b89f82..fbdb676 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SmartPtrArrayMismatchCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -117,6 +115,4 @@ void SmartPtrArrayMismatchCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp index ee45461..ff1d7da 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SpuriouslyWakeUpFunctionsCheck::registerMatchers(MatchFinder *Finder) { @@ -86,6 +84,4 @@ void SpuriouslyWakeUpFunctionsCheck::check( "conditional parameter}1") << WaitName << (WaitName != "cnd_wait" && WaitName != "cnd_timedwait"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp index 9236bb9..67d8e36 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp @@ -24,9 +24,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Casting.h" -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { using ast_matchers::BoundNodes; using ast_matchers::callee; @@ -207,6 +205,4 @@ void StandaloneEmptyCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp index cf3e17e..8ae4351 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER_P(IntegerLiteral, isBiggerThan, unsigned, N) { @@ -183,6 +181,4 @@ void StringConstructorCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp index 85d99ee..4f93b3e 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void StringIntegerAssignmentCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -177,6 +175,4 @@ void StringIntegerAssignmentCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp index 080d4ab..72e680d 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(StringLiteral, containsNul) { @@ -79,6 +77,4 @@ void StringLiteralWithEmbeddedNulCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp index 205f0c4..ea50250 100644 --- a/clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp @@ -18,9 +18,7 @@ #include "clang/Tooling/Transformer/Stencil.h" #include "llvm/ADT/StringRef.h" -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { using namespace ::clang::ast_matchers; using namespace ::clang::transformer; @@ -302,6 +300,4 @@ StringviewNullptrCheck::StringviewNullptrCheck(StringRef Name, : utils::TransformerClangTidyCheck(StringviewNullptrCheckImpl(), Name, Context) {} -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp index 3eda213..3bd8350 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static const char DifferentEnumErrorMessage[] = "enum values are from different enum types"; @@ -208,6 +206,4 @@ void SuspiciousEnumUsageCheck::check(const MatchFinder::MatchResult &Result) { checkSuspiciousBitmaskUsage(RhsExpr, EnumDec); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp index f3d2e3d7..13020bc 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp @@ -11,9 +11,7 @@ #include "clang/Lex/Preprocessor.h" #include -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { class SuspiciousIncludePPCallbacks : public PPCallbacks { @@ -104,6 +102,4 @@ void SuspiciousIncludePPCallbacks::InclusionDirective( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp index 57d0ff6..5f68ba6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemoryComparisonCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static std::optional tryEvaluateSizeExpr(const Expr *SizeExpr, const ASTContext &Ctx) { @@ -81,6 +79,4 @@ void SuspiciousMemoryComparisonCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp index 1abe470..a488d35 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SuspiciousMemsetUsageCheck::registerMatchers(MatchFinder *Finder) { // Match the standard memset: @@ -133,6 +131,4 @@ void SuspiciousMemsetUsageCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp index 1cd5508..81c38d0 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -125,6 +123,4 @@ void SuspiciousMissingCommaCheck::check( "suspicious string literal, probably missing a comma"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp index 9b78c21..8a6dcc3 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp @@ -103,9 +103,7 @@ public: } // namespace -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SuspiciousReallocUsageCheck::registerMatchers(MatchFinder *Finder) { // void *realloc(void *ptr, size_t size); @@ -158,6 +156,4 @@ void SuspiciousReallocUsageCheck::check( << PtrResultExpr->getSourceRange(); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp index 3874a52..92b772d 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SuspiciousSemicolonCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -73,6 +71,4 @@ void SuspiciousSemicolonCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateRemoval(SourceRange(LocStart, LocEnd)); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp index aec5a4d..151f249 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { // Semicolon separated list of known string compare-like functions. The list // must ends with a semicolon. @@ -207,6 +205,4 @@ void SuspiciousStringCompareCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/SwappedArgumentsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SwappedArgumentsCheck.cpp index 247c185..078aed6 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SwappedArgumentsCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SwappedArgumentsCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void SwappedArgumentsCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(callExpr().bind("call"), this); @@ -96,6 +94,4 @@ void SwappedArgumentsCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp index 65da4c3..e8f63fb 100644 --- a/clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void TerminatingContinueCheck::registerMatchers(MatchFinder *Finder) { const auto DoWithFalse = @@ -44,6 +42,4 @@ void TerminatingContinueCheck::check(const MatchFinder::MatchResult &Result) { << tooling::fixit::createReplacement(*ContStmt, "break"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp index 3f5d875..64c155c 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) { auto CtorInitializerList = @@ -44,6 +42,4 @@ void ThrowKeywordMissingCheck::check(const MatchFinder::MatchResult &Result) { << TemporaryExpr->getType().getBaseTypeIdentifier()->getName(); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp index f5821fe..3da34fc 100644 --- a/clang-tools-extra/clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { static constexpr llvm::StringLiteral LoopName = llvm::StringLiteral("forLoopName"); @@ -175,6 +173,4 @@ void TooSmallLoopVariableCheck::check(const MatchFinder::MatchResult &Result) { << LoopVarType << UpperBoundType; } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp index c425e2b..f02eece 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp @@ -24,9 +24,7 @@ #include #include -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { using ast_matchers::MatchFinder; using dataflow::UncheckedOptionalAccessDiagnoser; using dataflow::UncheckedOptionalAccessModel; @@ -101,6 +99,4 @@ void UncheckedOptionalAccessCheck::check( diag(Loc, "unchecked access to optional value"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp index 514ee5a..c2631ce 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(CXXRecordDecl, isNotTriviallyCopyable) { @@ -65,6 +63,4 @@ void UndefinedMemoryManipulationCheck::check( } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp index 76a7a5d..bea447f 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER_P(Stmt, ignoringTemporaryExpr, @@ -75,6 +73,4 @@ void UndelegatedConstructorCheck::check( "A temporary object is created here instead"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.cpp index c558b31..b160e72 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnhandledExceptionAtNewCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { AST_MATCHER_P(CXXTryStmt, hasHandlerFor, ast_matchers::internal::Matcher, InnerMatcher) { @@ -73,6 +71,4 @@ void UnhandledExceptionAtNewCheck::check( "missing exception handler for allocation failure at 'new'"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp index bf4bb75..8121a36 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { UnhandledSelfAssignmentCheck::UnhandledSelfAssignmentCheck( StringRef Name, ClangTidyContext *Context) @@ -107,6 +105,4 @@ void UnhandledSelfAssignmentCheck::check( "operator=() does not handle self-assignment properly"); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp index 435c473..d96e752 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnusedRaiiCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(CXXRecordDecl, hasNonTrivialDestructor) { @@ -96,6 +94,4 @@ void UnusedRaiiCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp index 616155d..6049569 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -176,6 +174,4 @@ void UnusedReturnValueCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp index f8a8617..b7eadb8 100644 --- a/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp @@ -22,10 +22,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::utils; - -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { @@ -467,6 +464,4 @@ void UseAfterMoveCheck::check(const MatchFinder::MatchResult &Result) { emitDiagnostic(MovingCall, Arg, Use, this, Result.Context); } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp index f2aeac2..bebdce5 100644 --- a/clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace bugprone { +namespace clang::tidy::bugprone { namespace { AST_MATCHER(CXXMethodDecl, isStatic) { return Node.isStatic(); } @@ -267,6 +265,4 @@ void VirtualNearMissCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace bugprone -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp index 5686d3e..c3be9d6 100644 --- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp @@ -227,8 +227,7 @@ const llvm::StringRef CertErr33CCheckedFunctions = "::aligned_alloc;" } // namespace -namespace clang { -namespace tidy { +namespace clang::tidy { namespace cert { class CERTModule : public ClangTidyModule { @@ -341,5 +340,4 @@ static ClangTidyModuleRegistry::Add // and thus register the CERTModule. volatile int CERTModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/cert/CommandProcessorCheck.cpp b/clang-tools-extra/clang-tidy/cert/CommandProcessorCheck.cpp index 131ae9b3..1c57a8f 100644 --- a/clang-tools-extra/clang-tidy/cert/CommandProcessorCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/CommandProcessorCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void CommandProcessorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -38,6 +36,4 @@ void CommandProcessorCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getExprLoc(), "calling %0 uses a command processor") << Fn; } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp b/clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp index 1b0cf89..2a0d0ad 100644 --- a/clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void DefaultOperatorNewAlignmentCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -63,6 +61,4 @@ void DefaultOperatorNewAlignmentCheck::check( << (SpecifiedAlignment / CharWidth); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp index c63673b..bc49708 100644 --- a/clang-tools-extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp @@ -37,9 +37,7 @@ AST_POLYMORPHIC_MATCHER_P( } // namespace -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void DontModifyStdNamespaceCheck::registerMatchers(MatchFinder *Finder) { auto HasStdParent = @@ -99,9 +97,7 @@ void DontModifyStdNamespaceCheck::registerMatchers(MatchFinder *Finder) { .bind("decl"), this); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert static const NamespaceDecl *getTopLevelLexicalNamespaceDecl(const Decl *D) { const NamespaceDecl *LastNS = nullptr; diff --git a/clang-tools-extra/clang-tidy/cert/FloatLoopCounter.cpp b/clang-tools-extra/clang-tidy/cert/FloatLoopCounter.cpp index b6b3b19..a936383 100644 --- a/clang-tools-extra/clang-tidy/cert/FloatLoopCounter.cpp +++ b/clang-tools-extra/clang-tidy/cert/FloatLoopCounter.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void FloatLoopCounter::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -29,6 +27,4 @@ void FloatLoopCounter::check(const MatchFinder::MatchResult &Result) { "floating-point type"); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.cpp b/clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.cpp index 0691787..f1d2bca 100644 --- a/clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/LimitedRandomnessCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void LimitedRandomnessCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(callExpr(callee(functionDecl(namedDecl(hasName("::rand")), @@ -32,6 +30,4 @@ void LimitedRandomnessCheck::check(const MatchFinder::MatchResult &Result) { diag(MatchedDecl->getBeginLoc(), "rand() has limited randomness" + Msg); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp b/clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp index d4ce995..a97fd72 100644 --- a/clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/MutatingCopyCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { static constexpr llvm::StringLiteral SourceDeclName = "ChangedPVD"; static constexpr llvm::StringLiteral MutatingOperatorName = "MutatingOp"; @@ -71,6 +69,4 @@ void MutatingCopyCheck::check(const MatchFinder::MatchResult &Result) { diag(Assignment->getBeginLoc(), "mutating copied object"); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.cpp b/clang-tools-extra/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.cpp index 5c8da5b..3fce682 100644 --- a/clang-tools-extra/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.cpp @@ -19,9 +19,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { namespace { AST_MATCHER(CXXRecordDecl, isTriviallyDefaultConstructible) { @@ -126,6 +124,4 @@ void NonTrivialTypesLibcMemoryCallsCheck::check( } } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp b/clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp index 0c4b896..8ff63ad 100644 --- a/clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void PostfixOperatorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(functionDecl(hasAnyOverloadedOperatorName("++", "--"), @@ -79,6 +77,4 @@ void PostfixOperatorCheck::check(const MatchFinder::MatchResult &Result) { Diag << FixItHint::CreateInsertion(Location, "const "); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp b/clang-tools-extra/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp index d35ddd0..cf7b36e 100644 --- a/clang-tools-extra/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/ProperlySeededRandomGeneratorCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { ProperlySeededRandomGeneratorCheck::ProperlySeededRandomGeneratorCheck( StringRef Name, ClangTidyContext *Context) @@ -120,6 +118,4 @@ void ProperlySeededRandomGeneratorCheck::checkSeed( } } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp index 99f1380..e7d9342 100644 --- a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { namespace { const char DiagWording[] = @@ -64,6 +62,4 @@ void SetLongJmpCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getExprLoc(), DiagWording) << cast(E->getCalleeDecl()); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp index 61ef166..c2a42a7 100644 --- a/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/StaticObjectExceptionCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void StaticObjectExceptionCheck::registerMatchers(MatchFinder *Finder) { // Match any static or thread_local variable declaration that has an @@ -55,6 +53,4 @@ void StaticObjectExceptionCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp b/clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp index c7abbe1..2caf31b 100644 --- a/clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void StrToNumCheck::registerMatchers(MatchFinder *Finder) { // Match any function call to the C standard library string conversion @@ -229,6 +227,4 @@ void StrToNumCheck::check(const MatchFinder::MatchResult &Result) { << classifyReplacement(Conversion); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp index 6b2579b..4452192 100644 --- a/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/ThrownExceptionTypeCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void ThrownExceptionTypeCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -34,6 +32,4 @@ void ThrownExceptionTypeCheck::check(const MatchFinder::MatchResult &Result) { "thrown exception type is not nothrow copy constructible"); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp index 25b255f..aeeedbb 100644 --- a/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp +++ b/clang-tools-extra/clang-tidy/cert/VariadicFunctionDefCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cert { +namespace clang::tidy::cert { void VariadicFunctionDefCheck::registerMatchers(MatchFinder *Finder) { // We only care about function *definitions* that are variadic, and do not @@ -33,6 +31,4 @@ void VariadicFunctionDefCheck::check(const MatchFinder::MatchResult &Result) { "parameter pack or currying instead"); } -} // namespace cert -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cert diff --git a/clang-tools-extra/clang-tidy/concurrency/ConcurrencyTidyModule.cpp b/clang-tools-extra/clang-tidy/concurrency/ConcurrencyTidyModule.cpp index 7ae891d..a88ee46 100644 --- a/clang-tools-extra/clang-tidy/concurrency/ConcurrencyTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/concurrency/ConcurrencyTidyModule.cpp @@ -12,8 +12,7 @@ #include "MtUnsafeCheck.h" #include "ThreadCanceltypeAsynchronousCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace concurrency { class ConcurrencyModule : public ClangTidyModule { @@ -36,5 +35,4 @@ static ClangTidyModuleRegistry::Add // and thus register the ConcurrencyModule. volatile int ConcurrencyModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp b/clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp index b087ad6..93a19d2 100644 --- a/clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp +++ b/clang-tools-extra/clang-tidy/concurrency/MtUnsafeCheck.cpp @@ -258,8 +258,7 @@ static const clang::StringRef PosixFunctions[] = { "::wctomb", }; -namespace clang { -namespace tidy { +namespace clang::tidy { template <> struct OptionEnumMapping { static llvm::ArrayRef< @@ -312,5 +311,4 @@ void MtUnsafeCheck::check(const MatchFinder::MatchResult &Result) { } } // namespace concurrency -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/concurrency/ThreadCanceltypeAsynchronousCheck.cpp b/clang-tools-extra/clang-tidy/concurrency/ThreadCanceltypeAsynchronousCheck.cpp index 736fff4..7bd79b2 100644 --- a/clang-tools-extra/clang-tidy/concurrency/ThreadCanceltypeAsynchronousCheck.cpp +++ b/clang-tools-extra/clang-tidy/concurrency/ThreadCanceltypeAsynchronousCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace concurrency { +namespace clang::tidy::concurrency { void ThreadCanceltypeAsynchronousCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -34,6 +32,4 @@ void ThreadCanceltypeAsynchronousCheck::check( "be 'PTHREAD_CANCEL_ASYNCHRONOUS'"); } -} // namespace concurrency -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::concurrency diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidConstOrRefDataMembersCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidConstOrRefDataMembersCheck.cpp index aa530ff..b22fa94 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidConstOrRefDataMembersCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidConstOrRefDataMembersCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { namespace { AST_MATCHER(FieldDecl, isMemberOfLambda) { @@ -44,6 +42,4 @@ void AvoidConstOrRefDataMembersCheck::check( << MatchedDecl << MatchedDecl->getType(); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.cpp index 1746b98..fd65865 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidDoWhileCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { AvoidDoWhileCheck::AvoidDoWhileCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -36,6 +34,4 @@ void AvoidDoWhileCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp index bd0d1ac..5e6a677 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { namespace { AST_MATCHER(GotoStmt, isForwardJumping) { @@ -46,6 +44,4 @@ void AvoidGotoCheck::check(const MatchFinder::MatchResult &Result) { diag(Goto->getLabel()->getBeginLoc(), "label defined here", DiagnosticIDs::Note); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp index f8ae76d..db723b1 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidNonConstGlobalVariablesCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { namespace { AST_MATCHER(VarDecl, isLocalVarDecl) { return Node.isLocalVarDecl(); } @@ -66,6 +64,4 @@ void AvoidNonConstGlobalVariablesCheck::check( } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp index 018aaad..17e09c2 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void AvoidReferenceCoroutineParametersCheck::registerMatchers( MatchFinder *Finder) { @@ -33,6 +31,4 @@ void AvoidReferenceCoroutineParametersCheck::check( } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp index 13a0cc7..d408682 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp @@ -40,8 +40,7 @@ #include "SpecialMemberFunctionsCheck.h" #include "VirtualClassDestructorCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace cppcoreguidelines { /// A module containing checks of the C++ Core Guidelines @@ -129,5 +128,4 @@ static ClangTidyModuleRegistry::Add // and thus register the CppCoreGuidelinesModule. volatile int CppCoreGuidelinesModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp index 75cc360..b4543e0 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { namespace { AST_MATCHER(VarDecl, isLocalVarDecl) { return Node.isLocalVarDecl(); } @@ -114,6 +112,4 @@ void InitVariablesCheck::check(const MatchFinder::MatchResult &Result) { } } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.cpp index 30a40cd..18d297f 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void InterfacesGlobalInitCheck::registerMatchers(MatchFinder *Finder) { const auto GlobalVarDecl = @@ -54,6 +52,4 @@ void InterfacesGlobalInitCheck::check(const MatchFinder::MatchResult &Result) { << Referencee; } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp index 94a646c..0cd4bf6 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp @@ -16,9 +16,7 @@ #include #include -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { static bool isCapsOnly(StringRef Name) { return llvm::all_of(Name, [](const char C) { @@ -106,6 +104,4 @@ void MacroUsageCheck::warnNaming(const MacroDirective *MD, << MacroName; } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp index d73a901..0815760 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp @@ -21,9 +21,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { NarrowingConversionsCheck::NarrowingConversionsCheck(StringRef Name, ClangTidyContext *Context) @@ -594,6 +592,4 @@ void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) { return handleImplicitCast(*Result.Context, *Cast); llvm_unreachable("must be binary operator or cast expression"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp index d7cf652..d232383 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void NoMallocCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "Allocations", AllocList); @@ -67,6 +65,4 @@ void NoMallocCheck::check(const MatchFinder::MatchResult &Result) { << Recommendation << SourceRange(Call->getBeginLoc(), Call->getEndLoc()); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp index b93bce2..4c18297 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void OwningMemoryCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "LegacyResourceProducers", LegacyResourceProducers); @@ -370,6 +368,4 @@ bool OwningMemoryCheck::handleOwnerMembers(const BoundNodes &Nodes) { return false; } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp index 16a2a69..68697db 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { static bool isControlStatement(const Stmt *S) { return isagetExprLoc(), "do not use pointer arithmetic"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp index 7d67301..ef803ab 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeConstCastCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void ProTypeConstCastCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(cxxConstCastExpr().bind("cast"), this); @@ -25,6 +23,4 @@ void ProTypeConstCastCheck::check(const MatchFinder::MatchResult &Result) { diag(MatchedCast->getOperatorLoc(), "do not use const_cast"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp index f172097..5e255dc 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { static bool needsConstCast(QualType SourceType, QualType DestType) { SourceType = SourceType.getNonReferenceType(); @@ -99,6 +97,4 @@ void ProTypeCstyleCastCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp index 975b51c..07b88d5 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp @@ -20,9 +20,7 @@ using namespace clang::tidy::matchers; using llvm::SmallPtrSet; using llvm::SmallPtrSetImpl; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { namespace { @@ -579,6 +577,4 @@ void ProTypeMemberInitCheck::checkUninitializedTrivialType( Context.getLangOpts().CPlusPlus11 ? "{}" : " = {}"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp index 66f0378..14456ca 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeReinterpretCastCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void ProTypeReinterpretCastCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(cxxReinterpretCastExpr().bind("cast"), this); @@ -27,6 +25,4 @@ void ProTypeReinterpretCastCheck::check( diag(MatchedCast->getOperatorLoc(), "do not use reinterpret_cast"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp index 0298685..5344d46 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeStaticCastDowncastCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void ProTypeStaticCastDowncastCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -46,6 +44,4 @@ void ProTypeStaticCastDowncastCheck::check( "do not use static_cast to downcast from a base to a derived class"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp index 635041b..1ed444e 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -29,6 +27,4 @@ void ProTypeUnionAccessCheck::check(const MatchFinder::MatchResult &Result) { "do not access members of unions; use (boost::)variant instead"); } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp index 83924f9..54c8992 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { const internal::VariadicDynCastAllOfMatcher VAArgExpr; @@ -193,6 +191,4 @@ void ProTypeVarargCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.cpp index 7cc3d74..bc094a2 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { void SlicingCheck::registerMatchers(MatchFinder *Finder) { // When we see: @@ -131,6 +129,4 @@ void SlicingCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp index 823075f..9bea2a7 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { SpecialMemberFunctionsCheck::SpecialMemberFunctionsCheck( StringRef Name, ClangTidyContext *Context) @@ -199,6 +197,4 @@ void SpecialMemberFunctionsCheck::checkForMissingMembers( } } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp index 98b48bd..aa70b38 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace cppcoreguidelines { +namespace clang::tidy::cppcoreguidelines { AST_MATCHER(CXXRecordDecl, hasPublicVirtualOrProtectedNonVirtualDestructor) { // We need to call Node.getDestructor() instead of matching a @@ -218,6 +216,4 @@ void VirtualClassDestructorCheck::check( << ProtectedAndVirtual << Fix; } -} // namespace cppcoreguidelines -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.cpp b/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.cpp index 2a52725..8864fdb 100644 --- a/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.cpp +++ b/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace darwin { +namespace clang::tidy::darwin { void AvoidSpinlockCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -31,6 +29,4 @@ void AvoidSpinlockCheck::check(const MatchFinder::MatchResult &Result) { "deprecated OSSpinLock"); } -} // namespace darwin -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::darwin diff --git a/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp b/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp index d11ef1f..3475dea 100644 --- a/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp @@ -12,8 +12,7 @@ #include "AvoidSpinlockCheck.h" #include "DispatchOnceNonstaticCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace darwin { class DarwinModule : public ClangTidyModule { @@ -36,5 +35,4 @@ static ClangTidyModuleRegistry::Add // and thus register the DarwinModule. volatile int DarwinModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/darwin/DispatchOnceNonstaticCheck.cpp b/clang-tools-extra/clang-tidy/darwin/DispatchOnceNonstaticCheck.cpp index dac7f83..75d38a9 100644 --- a/clang-tools-extra/clang-tidy/darwin/DispatchOnceNonstaticCheck.cpp +++ b/clang-tools-extra/clang-tidy/darwin/DispatchOnceNonstaticCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace darwin { +namespace clang::tidy::darwin { void DispatchOnceNonstaticCheck::registerMatchers(MatchFinder *Finder) { // Find variables without static or global storage. VarDecls do not include @@ -57,6 +55,4 @@ void DispatchOnceNonstaticCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace darwin -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::darwin diff --git a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp index fa814b8..96cd30e 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { void DefaultArgumentsCallsCheck::registerMatchers(MatchFinder *Finder) { // Calling a function which uses default arguments is disallowed. @@ -30,6 +28,4 @@ void DefaultArgumentsCallsCheck::check(const MatchFinder::MatchResult &Result) { DiagnosticIDs::Note); } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp index 273c322..05a663b 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp @@ -11,9 +11,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { void DefaultArgumentsDeclarationsCheck::registerMatchers(MatchFinder *Finder) { // Declaring default parameters is disallowed. @@ -50,6 +48,4 @@ void DefaultArgumentsDeclarationsCheck::check( << D << FixItHint::CreateRemoval(RemovalRange); } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp b/clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp index 39872fa..45a79b7 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp @@ -20,8 +20,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace fuchsia { /// This module is for Fuchsia-specific checks. @@ -55,5 +54,4 @@ static ClangTidyModuleRegistry::Add // and thus register the FuchsiaModule. volatile int FuchsiaModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp index ae3222a..060f3ae 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp @@ -13,9 +13,7 @@ using namespace clang; using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { namespace { AST_MATCHER(CXXRecordDecl, hasBases) { @@ -122,6 +120,4 @@ void MultipleInheritanceCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp index fb77efc..8586400 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { namespace { AST_MATCHER(FunctionDecl, isFuchsiaOverloadedOperator) { @@ -41,6 +39,4 @@ void OverloadedOperatorCheck::check(const MatchFinder::MatchResult &Result) { diag(Loc, "overloading %0 is disallowed") << D; } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp index 2ec5374..ac55d01 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp @@ -10,9 +10,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { namespace { AST_MATCHER(Expr, isConstantInitializer) { @@ -50,6 +48,4 @@ void StaticallyConstructedObjectsCheck::check( "constexpr constructor instead"); } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp index 2902e34..06e26376 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { void TrailingReturnCheck::registerMatchers(MatchFinder *Finder) { // Functions that have trailing returns are disallowed, except for those @@ -36,6 +34,4 @@ void TrailingReturnCheck::check(const MatchFinder::MatchResult &Result) { "a trailing return type is disallowed for this function declaration"); } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp index 54a4d73..9c36742 100644 --- a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp +++ b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace fuchsia { +namespace clang::tidy::fuchsia { namespace { AST_MATCHER(CXXRecordDecl, hasDirectVirtualBaseClass) { @@ -37,6 +35,4 @@ void VirtualInheritanceCheck::check(const MatchFinder::MatchResult &Result) { diag(D->getBeginLoc(), "direct virtual inheritance is disallowed"); } -} // namespace fuchsia -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::fuchsia diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp index f74d947..b7dcaf2 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp @@ -14,10 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace readability { +namespace clang::tidy::google::readability { void AvoidCStyleCastsCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -258,7 +255,4 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) { Diag << "static_cast/const_cast/reinterpret_cast"; } -} // namespace readability -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::readability diff --git a/clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp index aab07ba..adcbf24 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp @@ -19,10 +19,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace objc { +namespace clang::tidy::google::objc { static bool isMessageExpressionInsideMacro(const ObjCMessageExpr *Expr) { SourceLocation ReceiverLocation = Expr->getReceiverRange().getBegin(); @@ -123,7 +120,4 @@ void AvoidNSObjectNewCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace objc -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::objc diff --git a/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp index 9205125..8346ef2 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.cpp @@ -12,10 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace objc { +namespace clang::tidy::google::objc { void AvoidThrowingObjCExceptionCheck::registerMatchers(MatchFinder *Finder) { @@ -57,7 +54,4 @@ void AvoidThrowingObjCExceptionCheck::check( "Objective-C errors"); } -} // namespace objc -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::objc diff --git a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp index 783db8c..8ffcf47 100644 --- a/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp @@ -16,10 +16,7 @@ #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" -namespace clang { -namespace tidy { -namespace google { -namespace readability { +namespace clang::tidy::google::readability { constexpr llvm::StringLiteral KDisabledTestPrefix = "DISABLED_"; @@ -84,7 +81,4 @@ void AvoidUnderscoreInGoogletestNameCheck::registerPPCallbacks( std::make_unique(PP, this)); } -} // namespace readability -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::readability diff --git a/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.cpp b/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.cpp index 1ec2924..0b14a51 100644 --- a/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/DefaultArgumentsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { +namespace clang::tidy::google { void DefaultArgumentsCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -30,6 +28,4 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) { "default arguments on virtual or override methods are prohibited"); } -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp index 59f2dfb..f6b7ebc 100644 --- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { +namespace clang::tidy::google { void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -146,6 +144,4 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateInsertion(Loc, "explicit "); } -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google diff --git a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp index e719a42..d911b58 100644 --- a/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp @@ -20,9 +20,7 @@ AST_MATCHER(DeclRefExpr, hasExplicitTemplateArgs) { } } // namespace -namespace tidy { -namespace google { -namespace build { +namespace tidy::google::build { void ExplicitMakePairCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -66,7 +64,5 @@ void ExplicitMakePairCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace build -} // namespace google -} // namespace tidy +} // namespace tidy::google::build } // namespace clang diff --git a/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp b/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp index cedc385..e42b4e9 100644 --- a/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp @@ -13,10 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace objc { +namespace clang::tidy::google::objc { namespace { @@ -117,7 +114,4 @@ void FunctionNamingCheck::check(const MatchFinder::MatchResult &Result) { << MatchedDecl << IsGlobal << generateFixItHint(MatchedDecl); } -} // namespace objc -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::objc diff --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp index ae3738a..1c2a4e1 100644 --- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp @@ -14,10 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace readability { +namespace clang::tidy::google::readability { GlobalNamesInHeadersCheck::GlobalNamesInHeadersCheck(StringRef Name, ClangTidyContext *Context) @@ -74,7 +71,4 @@ void GlobalNamesInHeadersCheck::check(const MatchFinder::MatchResult &Result) { "using declarations in the global namespace in headers are prohibited"); } -} // namespace readability -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::readability diff --git a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp index 8b718ad9..a2a728f 100644 --- a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp @@ -16,10 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace objc { +namespace clang::tidy::google::objc { namespace { @@ -98,7 +95,4 @@ void GlobalVariableDeclarationCheck::check( } } -} // namespace objc -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::objc diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp index d8fcf3f..830a37a 100644 --- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp @@ -31,8 +31,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace google { class GoogleModule : public ClangTidyModule { @@ -103,5 +102,4 @@ static ClangTidyModuleRegistry::Add X("google-module", // and thus register the GoogleModule. volatile int GoogleModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp index e6bda4f6..53c6f5a 100644 --- a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp @@ -36,9 +36,7 @@ static Token getTokenAtLoc(SourceLocation Loc, return Tok; } -namespace tidy { -namespace google { -namespace runtime { +namespace tidy::google::runtime { IntegerTypesCheck::IntegerTypesCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -144,7 +142,5 @@ void IntegerTypesCheck::check(const MatchFinder::MatchResult &Result) { << Replacement; } -} // namespace runtime -} // namespace google -} // namespace tidy +} // namespace tidy::google::runtime } // namespace clang diff --git a/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp b/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp index 28aa5fa..a753660 100644 --- a/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/OverloadedUnaryAndCheck.cpp @@ -13,10 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace runtime { +namespace clang::tidy::google::runtime { void OverloadedUnaryAndCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -39,7 +36,4 @@ void OverloadedUnaryAndCheck::check(const MatchFinder::MatchResult &Result) { "do not overload unary operator&, it is dangerous."); } -} // namespace runtime -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::runtime diff --git a/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp b/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp index afc7fa40..adad54aa 100644 --- a/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/TodoCommentCheck.cpp @@ -11,10 +11,7 @@ #include "clang/Lex/Preprocessor.h" #include -namespace clang { -namespace tidy { -namespace google { -namespace readability { +namespace clang::tidy::google::readability { class TodoCommentCheck::TodoCommentHandler : public CommentHandler { public: @@ -64,7 +61,4 @@ void TodoCommentCheck::registerPPCallbacks(const SourceManager &SM, PP->addCommentHandler(Handler.get()); } -} // namespace readability -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::readability diff --git a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp index 5037799..72de9c1 100644 --- a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp @@ -13,10 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace build { +namespace clang::tidy::google::build { UnnamedNamespaceInHeaderCheck::UnnamedNamespaceInHeaderCheck( StringRef Name, ClangTidyContext *Context) @@ -54,7 +51,4 @@ void UnnamedNamespaceInHeaderCheck::check( diag(Loc, "do not use unnamed namespaces in header files"); } -} // namespace build -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::build diff --git a/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp b/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp index 36e1b3f..e7b4f9d 100644 --- a/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { +namespace clang::tidy::google { static const llvm::StringRef RenameCaseToSuiteMessage = "Google Test APIs named with 'case' are deprecated; use equivalent APIs " @@ -350,6 +348,4 @@ void UpgradeGoogletestCaseCheck::check(const MatchFinder::MatchResult &Result) { Diag << FixItHint::CreateReplacement(ReplacementRange, ReplacementText); } -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google diff --git a/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp b/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp index 20011fe..2f4913b 100644 --- a/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp +++ b/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp @@ -13,10 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace google { -namespace build { +namespace clang::tidy::google::build { void UsingNamespaceDirectiveCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -56,7 +53,4 @@ bool UsingNamespaceDirectiveCheck::isStdLiteralsNamespace( return Parent->getName() == "literals" && Parent->getParent() && Parent->getParent()->isStdNamespace(); } -} // namespace build -} // namespace google -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::google::build diff --git a/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp index 8181942..2b2acfd 100644 --- a/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp +++ b/clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace hicpp { +namespace clang::tidy::hicpp { void ExceptionBaseclassCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -58,6 +56,4 @@ void ExceptionBaseclassCheck::check(const MatchFinder::MatchResult &Result) { diag(TypeDecl->getBeginLoc(), "type defined here", DiagnosticIDs::Note); } -} // namespace hicpp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::hicpp diff --git a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp index 253c389..3749796 100644 --- a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp @@ -41,8 +41,7 @@ #include "NoAssemblerCheck.h" #include "SignedBitwiseCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace hicpp { class HICPPModule : public ClangTidyModule { @@ -120,5 +119,4 @@ static ClangTidyModuleRegistry::Add // and thus register the HICPPModule. volatile int HICPPModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp index 8b99a10..ebd20f2 100644 --- a/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp +++ b/clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace hicpp { +namespace clang::tidy::hicpp { void MultiwayPathsCoveredCheck::storeOptions( ClangTidyOptions::OptionMap &Opts) { @@ -174,6 +172,4 @@ void MultiwayPathsCoveredCheck::handleSwitchWithoutDefault( CaseCount == 1 ? "switch with only one case; use an if statement" : "potential uncovered code path; add a default label"); } -} // namespace hicpp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::hicpp diff --git a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp index af5a1cb..1dc2463 100644 --- a/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp +++ b/clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace hicpp { +namespace clang::tidy::hicpp { namespace { AST_MATCHER(VarDecl, isAsm) { return Node.hasAttr(); } @@ -44,6 +42,4 @@ void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) { diag(ASMLocation, "do not use inline assembler in safety-critical code"); } -} // namespace hicpp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::hicpp diff --git a/clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp b/clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp index 35631bd..51cc264 100644 --- a/clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp +++ b/clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; -namespace clang { -namespace tidy { -namespace hicpp { +namespace clang::tidy::hicpp { SignedBitwiseCheck::SignedBitwiseCheck(StringRef Name, ClangTidyContext *Context) @@ -100,6 +98,4 @@ void SignedBitwiseCheck::check(const MatchFinder::MatchResult &Result) { << IsUnary << SignedOperand->getSourceRange() << OperatorLoc; } -} // namespace hicpp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::hicpp diff --git a/clang-tools-extra/clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp b/clang-tools-extra/clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp index e1615ac..e6d64ff 100644 --- a/clang-tools-extra/clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/linuxkernel/LinuxKernelTidyModule.cpp @@ -11,8 +11,7 @@ #include "../ClangTidyModuleRegistry.h" #include "MustCheckErrsCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace linuxkernel { /// This module is for checks specific to the Linux kernel. @@ -33,5 +32,4 @@ static ClangTidyModuleRegistry::Add // and thus register the LinuxKernelModule. volatile int LinuxKernelModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp b/clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp index aa8c991..400ec0d 100644 --- a/clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp +++ b/clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace linuxkernel { +namespace clang::tidy::linuxkernel { void MustCheckErrsCheck::registerMatchers(MatchFinder *Finder) { auto ErrFn = @@ -48,6 +46,4 @@ void MustCheckErrsCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace linuxkernel -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::linuxkernel diff --git a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp b/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp index 53c1e3c..8d35ff5 100644 --- a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp @@ -10,9 +10,7 @@ #include "clang/Tooling/Tooling.h" #include "llvm/Support/Path.h" -namespace clang { -namespace tidy { -namespace llvm_check { +namespace clang::tidy::llvm_check { LLVMHeaderGuardCheck::LLVMHeaderGuardCheck(StringRef Name, ClangTidyContext *Context) @@ -66,6 +64,4 @@ std::string LLVMHeaderGuardCheck::getHeaderGuard(StringRef Filename, return StringRef(Guard).upper(); } -} // namespace llvm_check -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_check diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp index 5cf40644..3bfd667 100644 --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp @@ -14,9 +14,7 @@ #include -namespace clang { -namespace tidy { -namespace llvm_check { +namespace clang::tidy::llvm_check { namespace { class IncludeOrderPPCallbacks : public PPCallbacks { @@ -183,6 +181,4 @@ void IncludeOrderPPCallbacks::EndOfMainFile() { IncludeDirectives.clear(); } -} // namespace llvm_check -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_check diff --git a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp b/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp index 7e8bfdc..e7491636 100644 --- a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp @@ -18,8 +18,7 @@ #include "PreferRegisterOverUnsignedCheck.h" #include "TwineLocalCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace llvm_check { class LLVMModule : public ClangTidyModule { @@ -60,5 +59,4 @@ static ClangTidyModuleRegistry::Add X("llvm-module", // and thus register the LLVMModule. volatile int LLVMModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp b/clang-tools-extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp index 201c8d2..2308d77f 100644 --- a/clang-tools-extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/PreferIsaOrDynCastInConditionalsCheck.cpp @@ -19,8 +19,7 @@ namespace ast_matchers { AST_MATCHER(Expr, isMacroID) { return Node.getExprLoc().isMacroID(); } } // namespace ast_matchers -namespace tidy { -namespace llvm_check { +namespace tidy::llvm_check { void PreferIsaOrDynCastInConditionalsCheck::registerMatchers( MatchFinder *Finder) { @@ -130,6 +129,5 @@ void PreferIsaOrDynCastInConditionalsCheck::check( } } -} // namespace llvm_check -} // namespace tidy +} // namespace tidy::llvm_check } // namespace clang diff --git a/clang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp b/clang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp index 6e8cabe..5d19555 100644 --- a/clang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/PreferRegisterOverUnsignedCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace llvm_check { +namespace clang::tidy::llvm_check { void PreferRegisterOverUnsignedCheck::registerMatchers(MatchFinder *Finder) { auto RegisterClassMatch = hasType( @@ -61,6 +59,4 @@ void PreferRegisterOverUnsignedCheck::check( NeedsQualification ? "llvm::Register" : "Register"); } -} // namespace llvm_check -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_check diff --git a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp index 907bdcb..42e53ef 100644 --- a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace llvm_check { +namespace clang::tidy::llvm_check { void TwineLocalCheck::registerMatchers(MatchFinder *Finder) { auto TwineType = @@ -62,6 +60,4 @@ void TwineLocalCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace llvm_check -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_check diff --git a/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp index 8f4f545..98ae857 100644 --- a/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace llvm_libc { +namespace clang::tidy::llvm_libc { // Gets the outermost namespace of a DeclContext, right under the Translation // Unit. @@ -65,6 +63,4 @@ void CalleeNamespaceCheck::check(const MatchFinder::MatchResult &Result) { clang::DiagnosticIDs::Note); } -} // namespace llvm_libc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_libc diff --git a/clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp index 842bf43..d05310f 100644 --- a/clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvmlibc/ImplementationInNamespaceCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace llvm_libc { +namespace clang::tidy::llvm_libc { const static StringRef RequiredNamespace = "__llvm_libc"; void ImplementationInNamespaceCheck::registerMatchers(MatchFinder *Finder) { @@ -43,6 +41,4 @@ void ImplementationInNamespaceCheck::check( << RequiredNamespace; } -} // namespace llvm_libc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_libc diff --git a/clang-tools-extra/clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp b/clang-tools-extra/clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp index 61cfe29..670be8b 100644 --- a/clang-tools-extra/clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/llvmlibc/LLVMLibcTidyModule.cpp @@ -13,8 +13,7 @@ #include "ImplementationInNamespaceCheck.h" #include "RestrictSystemLibcHeadersCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace llvm_libc { class LLVMLibcModule : public ClangTidyModule { @@ -39,5 +38,4 @@ static ClangTidyModuleRegistry::Add // and thus register the LLVMLibcModule. volatile int LLVMLibcModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp b/clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp index 4bbbc57..3451d34 100644 --- a/clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp @@ -16,9 +16,7 @@ // FixItHint - Hint to check documentation script to mark this check as // providing a FixIt. -namespace clang { -namespace tidy { -namespace llvm_libc { +namespace clang::tidy::llvm_libc { namespace { @@ -66,6 +64,4 @@ void RestrictSystemLibcHeadersCheck::registerPPCallbacks( *this, SM, CompilerIncudeDir)); } -} // namespace llvm_libc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::llvm_libc diff --git a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp index 73e28fb..355e097 100644 --- a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp @@ -21,9 +21,7 @@ namespace { #include "Confusables.inc" } // namespace -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { ConfusableIdentifierCheck::ConfusableIdentifierCheck(StringRef Name, ClangTidyContext *Context) @@ -169,6 +167,4 @@ void ConfusableIdentifierCheck::registerMatchers( Finder->addMatcher(ast_matchers::namedDecl().bind("nameddecl"), this); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp b/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp index 2ce1dc1..b7c2f28 100644 --- a/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { // FIXME: This matcher exists in some other code-review as well. @@ -207,6 +205,4 @@ void ConstCorrectnessCheck::registerScope(const CompoundStmt *LocalScope, Analyzer = std::make_unique(*LocalScope, *Context); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp index 9a7a7e1..c894d7e 100644 --- a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { @@ -160,6 +158,4 @@ void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index ec99733..2ec61f8 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -29,8 +29,7 @@ #include "UnusedUsingDeclsCheck.h" #include "UseAnonymousNamespaceCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace misc { class MiscModule : public ClangTidyModule { @@ -84,5 +83,4 @@ static ClangTidyModuleRegistry::Add // and thus register the MiscModule. volatile int MiscModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp index 4ddb8ba..e1b98b8 100644 --- a/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp +++ b/clang-tools-extra/clang-tidy/misc/MisleadingIdentifier.cpp @@ -11,9 +11,7 @@ #include "clang/Frontend/CompilerInstance.h" #include "llvm/Support/ConvertUTF.h" -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { // See https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedBidiClass.txt static bool isUnassignedAL(llvm::UTF32 CP) { @@ -161,6 +159,4 @@ void MisleadingIdentifierCheck::registerMatchers( Finder->addMatcher(ast_matchers::namedDecl().bind("nameddecl"), this); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp b/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp index 62df088..4aaf64c 100644 --- a/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { void MisplacedConstCheck::registerMatchers(MatchFinder *Finder) { auto NonConstAndNonFunctionPointerType = hasType(pointerType(unless( @@ -74,6 +72,4 @@ void MisplacedConstCheck::check(const MatchFinder::MatchResult &Result) { diag(AliasLoc, "%0 declared here", DiagnosticIDs::Note) << AliasType; } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp index 3f5d597..e772bcc 100644 --- a/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { @@ -204,6 +202,4 @@ void NewDeleteOverloadsCheck::onEndOfTranslationUnit() { << FD << getOperatorName(getCorrespondingOverload(FD)); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp index 3cd019d..2250bba 100644 --- a/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { @@ -270,6 +268,4 @@ void NoRecursionCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp index 53cc273..4c415a7 100644 --- a/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp +++ b/clang-tools-extra/clang-tidy/misc/NonCopyableObjects.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { void NonCopyableObjectsCheck::registerMatchers(MatchFinder *Finder) { // There are two ways to get into trouble with objects like FILE *: @@ -67,7 +65,4 @@ void NonCopyableObjectsCheck::check(const MatchFinder::MatchResult &Result) { << BD; } -} // namespace misc -} // namespace tidy -} // namespace clang - +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp b/clang-tools-extra/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp index ed736d1..9d7d9d1 100644 --- a/clang-tools-extra/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/NonPrivateMemberVariablesInClassesCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { @@ -92,6 +90,4 @@ void NonPrivateMemberVariablesInClassesCheck::check( << Field << Field->getAccess(); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp b/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp index 40f5b13..b502807 100644 --- a/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp @@ -32,9 +32,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { using llvm::APSInt; @@ -1357,6 +1355,4 @@ void RedundantExpressionCheck::check(const MatchFinder::MatchResult &Result) { checkRelationalExpr(Result); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp index 6203e19..a2fba67 100644 --- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp @@ -20,9 +20,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { StaticAssertCheck::StaticAssertCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context) {} @@ -167,6 +165,4 @@ SourceLocation StaticAssertCheck::getLastParenLoc(const ASTContext *ASTCtx, return Token.getLocation(); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp index 37a81da..abe7bed 100644 --- a/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { ThrowByValueCatchByReferenceCheck::ThrowByValueCatchByReferenceCheck( StringRef Name, ClangTidyContext *Context) @@ -170,6 +168,4 @@ void ThrowByValueCatchByReferenceCheck::diagnoseCatchLocations( } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp index 12ba5d9..42c4b6e 100644 --- a/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { void UnconventionalAssignOperatorCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { @@ -89,6 +87,4 @@ void UnconventionalAssignOperatorCheck::check( } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp b/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp index 7ffbaa4..0e24b47 100644 --- a/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { UniqueptrResetReleaseCheck::UniqueptrResetReleaseCheck( StringRef Name, ClangTidyContext *Context) @@ -148,6 +146,4 @@ void UniqueptrResetReleaseCheck::check(const MatchFinder::MatchResult &Result) { Result.SourceManager->getFileID(ResetMember->getBeginLoc()), ""); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp index bebf831..2dfaca1 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedAliasDeclsCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { void UnusedAliasDeclsCheck::registerMatchers(MatchFinder *Finder) { // We cannot do anything about headers (yet), as the alias declarations @@ -53,6 +51,4 @@ void UnusedAliasDeclsCheck::onEndOfTranslationUnit() { } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp index 6691320..2c69cb0 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { bool isOverrideMethod(const FunctionDecl *Function) { @@ -198,6 +196,4 @@ void UnusedParametersCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp index 6aee030..3602aa4 100644 --- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { @@ -201,6 +199,4 @@ void UnusedUsingDeclsCheck::onEndOfTranslationUnit() { Contexts.clear(); } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp index 909bf79..7e4bba2 100644 --- a/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace misc { +namespace clang::tidy::misc { namespace { AST_POLYMORPHIC_MATCHER_P(isInHeaderFile, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, @@ -74,6 +72,4 @@ void UseAnonymousNamespaceCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace misc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp index 8783a54..598a9ae 100644 --- a/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp @@ -29,9 +29,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -717,6 +715,4 @@ void AvoidBindCheck::check(const MatchFinder::MatchResult &Result) { Stream.str()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp index 872dd18..d1b1547 100644 --- a/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp @@ -38,9 +38,7 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { } // namespace -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -63,6 +61,4 @@ void AvoidCArraysCheck::check(const MatchFinder::MatchResult &Result) { << ArrayType->getTypePtr()->isVariableArrayType(); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp index e55b260..0d815da 100644 --- a/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ConcatNestedNamespacesCheck.cpp @@ -12,9 +12,7 @@ #include "clang/Lex/Lexer.h" #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static bool locationsInSameFile(const SourceManager &Sources, SourceLocation Loc1, SourceLocation Loc2) { @@ -102,6 +100,4 @@ void ConcatNestedNamespacesCheck::check( Namespaces.clear(); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp index 2498ec9..7d4659c 100644 --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp @@ -19,9 +19,7 @@ using IncludeMarker = clang::tidy::modernize::DeprecatedHeadersCheck::IncludeMarker; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { class IncludeModernizePPCallbacks : public PPCallbacks { @@ -211,6 +209,4 @@ void IncludeModernizePPCallbacks::InclusionDirective( } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp index 1d818c5..a1607c8 100644 --- a/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp @@ -13,9 +13,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", @@ -72,6 +70,4 @@ void DeprecatedIosBaseAliasesCheck::check( 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/IntegralLiteralExpressionMatcher.cpp b/clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMatcher.cpp index ca0e99f..9b97b46 100644 --- a/clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMatcher.cpp +++ b/clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMatcher.cpp @@ -12,9 +12,7 @@ #include #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { // Validate that this literal token is a valid integer literal. A literal token // could be a floating-point token, which isn't acceptable as a value for an @@ -285,6 +283,4 @@ LiteralSize IntegralLiteralExpressionMatcher::largestLiteralSize() const { return LargestSize; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp index 0056acb..fe9412f 100644 --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp @@ -27,8 +27,7 @@ using namespace clang::ast_matchers; using namespace llvm; -namespace clang { -namespace tidy { +namespace clang::tidy { template <> struct OptionEnumMapping { static llvm::ArrayRef> @@ -970,5 +969,4 @@ llvm::StringRef LoopConvertCheck::getReverseHeader() const { } } // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp index 0cad244..deb82b4 100644 --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp @@ -27,9 +27,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { /// Tracks a stack of parent statements during traversal. /// @@ -911,6 +909,4 @@ bool VariableNamer::declarationExists(StringRef Symbol) { return DeclFinder.findUsages(SourceStmt); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp index a3f5f2d..428bfb1 100644 --- a/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp @@ -18,9 +18,7 @@ #include #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static bool hasOnlyComments(SourceLocation Loc, const LangOptions &Options, StringRef Text) { @@ -556,6 +554,4 @@ void MacroToEnumCheck::check( PPCallback->invalidateRange(Range); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp index 5ab3f3e..69f7d9f 100644 --- 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 @@ MakeSharedCheck::getSmartPointerTypeMatcher() const { qualType().bind(PointerType))))))))); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp index 6d5f94de..2f9f47d 100644 --- a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -439,6 +437,4 @@ void MakeSmartPtrCheck::insertHeader(DiagnosticBuilder &Diag, FileID FD) { Diag << Inserter.createIncludeInsertion(FD, MakeSmartPtrFunctionHeader); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp index e2f812b..d4d9f700 100644 --- 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,4 @@ bool MakeUniqueCheck::isLanguageVersionSupported( // FixItHint is done by MakeSmartPtrCheck -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp index 0807635..97d24e5 100644 --- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp @@ -44,8 +44,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace modernize { class ModernizeModule : public ClangTidyModule { @@ -130,5 +129,4 @@ static ClangTidyModuleRegistry::Add X("modernize-module", // and thus register the ModernizeModule. volatile int ModernizeModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp index f9dd542..ff3b3a7c 100644 --- 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. @@ -305,6 +303,4 @@ void PassByValueCheck::check(const MatchFinder::MatchResult &Result) { ""); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp index d4b8fc8..57e4c48 100644 --- 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 @@ void RawStringLiteralCheck::replaceWithRawStringLiteral( << FixItHint::CreateReplacement(CharRange, Replacement); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp index 4f791d4..53447c2 100644 --- 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 { @@ -287,6 +285,4 @@ void RedundantVoidArgCheck::processLambdaExpr( } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp index 84c17ef..4587b08 100644 --- 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"; @@ -150,6 +148,4 @@ void ReplaceAutoPtrCheck::check(const MatchFinder::MatchResult &Result) { "unique_ptr"); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp index 6c35e24..42be7d7 100644 --- a/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ReplaceDisallowCopyAndAssignMacroCheck.cpp @@ -14,9 +14,7 @@ #include "llvm/Support/FormatVariadic.h" #include -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { @@ -88,6 +86,4 @@ void ReplaceDisallowCopyAndAssignMacroCheck::storeOptions( 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.cpp b/clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp index 2f17065..f5d13f3 100644 --- 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) @@ -96,6 +94,4 @@ void ReplaceRandomShuffleCheck::check(const MatchFinder::MatchResult &Result) { ""); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp index 4c8b957..407de61 100644 --- 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. @@ -82,6 +80,4 @@ void ReturnBracedInitListCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateReplacement(CallParensRange.getEnd(), "}"); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp b/clang-tools-extra/clang-tidy/modernize/ShrinkToFitCheck.cpp index 411f04e..b971b82 100644 --- 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 @@ -75,6 +73,4 @@ void ShrinkToFitCheck::check(const MatchFinder::MatchResult &Result) { << Hint; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp index c074b93..81b2156 100644 --- 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 @@ void UnaryStaticAssertCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateRemoval(AssertMessage->getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp index a4a81ce..7af30e6 100644 --- 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; 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"; @@ -449,6 +447,4 @@ void UseAutoCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseBoolLiteralsCheck.cpp index ad11e39..c8e6bf4 100644 --- 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 @@ void UseBoolLiteralsCheck::check(const MatchFinder::MatchResult &Result) { 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.cpp b/clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp index 6f8c984..d3e7bd4 100644 --- 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) { @@ -296,6 +294,4 @@ void UseDefaultMemberInitCheck::checkExistingInit( << FixItHint::CreateRemoval(Init->getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp index 1b7853d..045d7fb 100644 --- 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 { // Identical to hasAnyName, except it does not take template specifiers into @@ -374,6 +372,4 @@ void UseEmplaceCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { utils::options::serializeStringList(EmplacyFunctions)); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp index aac7c88..d48d43f 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { static const char SpecialFunction[] = "SpecialFunction"; @@ -355,6 +353,4 @@ void UseEqualsDefaultCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp index 7d5ae89..b82c01e 100644 --- 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 @@ void UseEqualsDeleteCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNodiscardCheck.cpp index 1b2a80d..16ea46e 100644 --- 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 @@ bool UseNodiscardCheck::isLanguageVersionSupported( return LangOpts.CPlusPlus; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp index 6cc6b0f..9ba9e6d 100644 --- 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(); } @@ -105,6 +103,4 @@ void UseNoexceptCheck::check(const MatchFinder::MatchResult &Result) { << ReplacementStr.empty() << ReplacementStr << FixIt; } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp index 220a310..9270334 100644 --- 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; using namespace clang::ast_matchers; using namespace llvm; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { const char CastSequence[] = "sequence"; @@ -510,6 +508,4 @@ void UseNullptrCheck::check(const MatchFinder::MatchResult &Result) { .TraverseStmt(const_cast(NullCast)); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseOverrideCheck.cpp index c78fd7f..a3201c8 100644 --- 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 @@ void UseOverrideCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp index 070ba9a..00c7d41 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp @@ -19,9 +19,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace modernize { +namespace clang::tidy::modernize { namespace { struct UnqualNameVisitor : public RecursiveASTVisitor { public: @@ -496,6 +494,4 @@ void UseTrailingReturnTypeCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateInsertion(InsertionLoc, " -> " + ReturnType); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseTransparentFunctorsCheck.cpp index 58bd9e7..2223a19 100644 --- 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 @@ void UseTransparentFunctorsCheck::check( FunctorTypeLoc.getArgLoc(0).getSourceRange()); } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp index b9d68ce..06a2778 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp @@ -13,9 +13,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"; @@ -97,6 +95,4 @@ void UseUncaughtExceptionsCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace modernize -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp index fa3cfa5..c1af8b5 100644 --- 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 { static constexpr llvm::StringLiteral ParentDeclName = "parent-decl"; static constexpr llvm::StringLiteral TagDeclName = "tag-decl"; @@ -142,6 +140,4 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { 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-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp b/clang-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp index ebe9658..a144296 100644 --- a/clang-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp +++ b/clang-tools-extra/clang-tidy/mpi/BufferDerefCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace mpi { +namespace clang::tidy::mpi { void BufferDerefCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(callExpr().bind("CE"), this); @@ -128,6 +126,4 @@ void BufferDerefCheck::checkBuffers(ArrayRef BufferTypes, } void BufferDerefCheck::onEndOfTranslationUnit() { FuncClassifier.reset(); } -} // namespace mpi -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::mpi diff --git a/clang-tools-extra/clang-tidy/mpi/MPITidyModule.cpp b/clang-tools-extra/clang-tidy/mpi/MPITidyModule.cpp index b295d5f..166d71e 100644 --- a/clang-tools-extra/clang-tidy/mpi/MPITidyModule.cpp +++ b/clang-tools-extra/clang-tidy/mpi/MPITidyModule.cpp @@ -12,8 +12,7 @@ #include "BufferDerefCheck.h" #include "TypeMismatchCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace mpi { class MPIModule : public ClangTidyModule { @@ -34,5 +33,4 @@ static ClangTidyModuleRegistry::Add // and thus register the MPIModule. volatile int MPIModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/mpi/TypeMismatchCheck.cpp b/clang-tools-extra/clang-tidy/mpi/TypeMismatchCheck.cpp index 6f7bfe6..903fd42 100644 --- a/clang-tools-extra/clang-tidy/mpi/TypeMismatchCheck.cpp +++ b/clang-tools-extra/clang-tidy/mpi/TypeMismatchCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace mpi { +namespace clang::tidy::mpi { /// Check if a BuiltinType::Kind matches the MPI datatype. /// @@ -330,6 +328,4 @@ void TypeMismatchCheck::checkArguments(ArrayRef BufferTypes, } void TypeMismatchCheck::onEndOfTranslationUnit() { FuncClassifier.reset(); } -} // namespace mpi -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::mpi diff --git a/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp b/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp index 198e7f0..da98e19 100644 --- a/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp +++ b/clang-tools-extra/clang-tidy/objc/AssertEquals.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { // Mapping from `XCTAssert*Equal` to `XCTAssert*EqualObjects` name. static const std::map &NameMap() { @@ -60,6 +58,4 @@ void AssertEquals::check(const ast_matchers::MatchFinder::MatchResult &result) { } } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/AvoidNSErrorInitCheck.cpp b/clang-tools-extra/clang-tidy/objc/AvoidNSErrorInitCheck.cpp index de3fdd6..3624cab 100644 --- a/clang-tools-extra/clang-tidy/objc/AvoidNSErrorInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/AvoidNSErrorInitCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { void AvoidNSErrorInitCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(objcMessageExpr(hasSelector("init"), @@ -31,6 +29,4 @@ void AvoidNSErrorInitCheck::check(const MatchFinder::MatchResult &Result) { "create a new NSError"); } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/DeallocInCategoryCheck.cpp b/clang-tools-extra/clang-tidy/objc/DeallocInCategoryCheck.cpp index 8c5ecb7..d188153 100644 --- a/clang-tools-extra/clang-tidy/objc/DeallocInCategoryCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/DeallocInCategoryCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { void DeallocInCategoryCheck::registerMatchers(MatchFinder *Finder) { // Non-NSObject/NSProxy-derived objects may not have -dealloc as a special @@ -37,6 +35,4 @@ void DeallocInCategoryCheck::check(const MatchFinder::MatchResult &Result) { << CID; } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/ForbiddenSubclassingCheck.cpp b/clang-tools-extra/clang-tidy/objc/ForbiddenSubclassingCheck.cpp index 4e69ac9..21ba41d 100644 --- a/clang-tools-extra/clang-tidy/objc/ForbiddenSubclassingCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/ForbiddenSubclassingCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { namespace { @@ -80,6 +78,4 @@ void ForbiddenSubclassingCheck::storeOptions( utils::options::serializeStringList(ForbiddenSuperClassNames)); } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp b/clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp index 26104ed..42f383e 100644 --- a/clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/MissingHashCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { namespace { @@ -53,6 +51,4 @@ void MissingHashCheck::check(const MatchFinder::MatchResult &Result) { << ID; } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp b/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp index f8a4d6e..fe18958 100644 --- a/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { void NSDateFormatterCheck::registerMatchers(MatchFinder *Finder) { // Adding matchers. @@ -105,6 +103,4 @@ void NSDateFormatterCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp b/clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp index c41336f..bd9bdd1 100644 --- a/clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp @@ -28,9 +28,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { namespace { static constexpr StringRef WeakText = "__weak"; @@ -142,6 +140,4 @@ void NSInvocationArgumentLifetimeCheck::check( Diag << *Hint; } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp index 0cfab1f..b6f8888 100644 --- a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp @@ -21,8 +21,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace objc { class ObjCModule : public ClangTidyModule { @@ -59,5 +58,4 @@ static ClangTidyModuleRegistry::Add X( // and thus register the ObjCModule. volatile int ObjCModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp index 758d397..d72c17a 100644 --- a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { namespace { @@ -133,6 +131,4 @@ void PropertyDeclarationCheck::check(const MatchFinder::MatchResult &Result) { << generateFixItHint(MatchedDecl, StandardProperty); } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp b/clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp index 75735a3..951cbc5 100644 --- a/clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace objc { +namespace clang::tidy::objc { namespace { @@ -104,6 +102,4 @@ void SuperSelfCheck::check(const MatchFinder::MatchResult &Result) { StringRef("[super init]")); } -} // namespace objc -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::objc diff --git a/clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.cpp b/clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.cpp index aa06941..b414fd3 100644 --- a/clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.cpp +++ b/clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace openmp { +namespace clang::tidy::openmp { ExceptionEscapeCheck::ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context) @@ -71,6 +69,4 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) { << getOpenMPDirectiveName(Directive->getDirectiveKind()); } -} // namespace openmp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::openmp diff --git a/clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp b/clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp index cb0e247..37092f4 100644 --- a/clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp @@ -12,8 +12,7 @@ #include "ExceptionEscapeCheck.h" #include "UseDefaultNoneCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace openmp { /// This module is for OpenMP-specific checks. @@ -37,5 +36,4 @@ static ClangTidyModuleRegistry::Add // and thus register the OpenMPModule. volatile int OpenMPModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cpp b/clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cpp index 724e9b9..f886d43 100644 --- a/clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cpp +++ b/clang-tools-extra/clang-tidy/openmp/UseDefaultNoneCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace openmp { +namespace clang::tidy::openmp { void UseDefaultNoneCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -55,6 +53,4 @@ void UseDefaultNoneCheck::check(const MatchFinder::MatchResult &Result) { << getOpenMPDirectiveName(Directive->getDirectiveKind()); } -} // namespace openmp -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::openmp diff --git a/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp b/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp index fba4fb9..d932b5f 100644 --- a/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { @@ -95,6 +93,4 @@ void FasterStringFindCheck::check(const MatchFinder::MatchResult &Result) { *Replacement); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp index 8ffbd9f..5bfa6fb 100644 --- a/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/ForRangeCopyCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { ForRangeCopyCheck::ForRangeCopyCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context), @@ -132,6 +130,4 @@ bool ForRangeCopyCheck::handleCopyIsOnlyConstReferenced( return false; } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp b/clang-tools-extra/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp index 61e8366..86fca07 100644 --- a/clang-tools-extra/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/ImplicitConversionInLoopCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { // Checks if the stmt is a ImplicitCastExpr with a CastKind that is not a NoOp. // The subtlety is that in some cases (user defined conversions), we can @@ -101,6 +99,4 @@ void ImplicitConversionInLoopCheck::reportAndFix(const ASTContext *Context, diag(VD->getBeginLoc(), Message) << VD << ConstRefType; } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp b/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp index cd221f2..3c8751d 100644 --- a/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/InefficientAlgorithmCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { static bool areTypesCompatible(QualType Left, QualType Right) { if (const auto *LeftRefType = Left->getAs()) @@ -148,6 +146,4 @@ void InefficientAlgorithmCheck::check(const MatchFinder::MatchResult &Result) { << Hint; } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp b/clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp index f73643f..9e4e3f6 100644 --- a/clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { void InefficientStringConcatenationCheck::storeOptions( ClangTidyOptions::OptionMap &Opts) { @@ -79,6 +77,4 @@ void InefficientStringConcatenationCheck::check( diag(PlusOperator->getExprLoc(), DiagMsg); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp b/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp index d98df11..20aea5a 100644 --- a/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { @@ -273,6 +271,4 @@ void InefficientVectorOperationCheck::check( } } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp b/clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp index 9a9c915..8d4c6de 100644 --- a/clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { static void replaceCallWithArg(const CallExpr *Call, DiagnosticBuilder &Diag, const SourceManager &SM, @@ -206,6 +204,4 @@ void MoveConstArgCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp b/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp index dd6e5a8..0f47b40 100644 --- a/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/MoveConstructorInitCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { MoveConstructorInitCheck::MoveConstructorInitCheck(StringRef Name, ClangTidyContext *Context) @@ -84,6 +82,4 @@ void MoveConstructorInitCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/NoAutomaticMoveCheck.cpp b/clang-tools-extra/clang-tidy/performance/NoAutomaticMoveCheck.cpp index 21eba9a..b9c411e 100644 --- a/clang-tools-extra/clang-tidy/performance/NoAutomaticMoveCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/NoAutomaticMoveCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { NoAutomaticMoveCheck::NoAutomaticMoveCheck(StringRef Name, ClangTidyContext *Context) @@ -67,6 +65,4 @@ void NoAutomaticMoveCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { utils::options::serializeStringList(AllowedTypes)); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.cpp b/clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.cpp index bc82a21..f7a56c7 100644 --- a/clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/NoIntToPtrCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { void NoIntToPtrCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(castExpr(hasCastKind(CK_IntegralToPointer), @@ -29,6 +27,4 @@ void NoIntToPtrCheck::check(const MatchFinder::MatchResult &Result) { "integer to pointer cast pessimizes optimization opportunities"); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp b/clang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp index 782498b..3e65139 100644 --- a/clang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { void NoexceptMoveConstructorCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -77,6 +75,4 @@ void NoexceptMoveConstructorCheck::check( } } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp index ba9d7ee..30a195f 100644 --- a/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp @@ -25,8 +25,7 @@ #include "UnnecessaryCopyInitialization.h" #include "UnnecessaryValueParamCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace performance { class PerformanceModule : public ClangTidyModule { @@ -74,5 +73,4 @@ static ClangTidyModuleRegistry::Add // and thus register the PerformanceModule. volatile int PerformanceModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp b/clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp index 1c20e58..adfedb4 100644 --- a/clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; using namespace clang::ast_matchers::internal; using namespace clang::tidy::matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { @@ -74,6 +72,4 @@ void TriviallyDestructibleCheck::check(const MatchFinder::MatchResult &Result) { DiagnosticIDs::Note); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp index 4f7e6fe..869830a 100644 --- a/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { AST_MATCHER_P(Type, isBuiltinType, BuiltinType::Kind, Kind) { @@ -195,6 +193,4 @@ void TypePromotionInMathFnCheck::check(const MatchFinder::MatchResult &Result) { ""); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp index 7cdd4d3..d4e2162 100644 --- a/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp +++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp @@ -16,9 +16,7 @@ #include "clang/Basic/Diagnostic.h" #include -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { using namespace ::clang::ast_matchers; @@ -370,6 +368,4 @@ void UnnecessaryCopyInitialization::storeOptions( utils::options::serializeStringList(ExcludedContainerTypes)); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp b/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp index 6afe8fe..2fa7cd0 100644 --- a/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp +++ b/clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp @@ -20,9 +20,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace performance { +namespace clang::tidy::performance { namespace { @@ -193,6 +191,4 @@ void UnnecessaryValueParamCheck::handleMoveFix(const ParmVarDecl &Var, SM.getFileID(CopyArgument.getBeginLoc()), ""); } -} // namespace performance -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::performance diff --git a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp index 01402f1..b47ce2b 100644 --- a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp +++ b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp @@ -14,8 +14,7 @@ #include "clang/Frontend/FrontendPluginRegistry.h" #include "clang/Frontend/MultiplexConsumer.h" -namespace clang { -namespace tidy { +namespace clang::tidy { /// The core clang tidy plugin action. This just provides the AST consumer and /// command line flag parsing for using clang-tidy as a clang plugin. @@ -75,8 +74,7 @@ public: private: std::unique_ptr Context; }; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy // This anchor is used to force the linker to link in the generated object file // and thus register the clang-tidy plugin. diff --git a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp index 1e4f1d5..b3759a7 100644 --- a/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp @@ -13,8 +13,7 @@ #include "SIMDIntrinsicsCheck.h" #include "StdAllocatorConstCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace portability { class PortabilityModule : public ClangTidyModule { @@ -39,5 +38,4 @@ static ClangTidyModuleRegistry::Add // and thus register the PortabilityModule. volatile int PortabilityModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp b/clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp index 3509cd4..9ee0b4e 100644 --- a/clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp +++ b/clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp @@ -16,9 +16,7 @@ #include "llvm/Support/Path.h" #include -namespace clang { -namespace tidy { -namespace portability { +namespace clang::tidy::portability { void RestrictedIncludesPPCallbacks::InclusionDirective( SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, @@ -75,6 +73,4 @@ void RestrictSystemIncludesCheck::storeOptions( Options.store(Opts, "Includes", AllowedIncludes); } -} // namespace portability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::portability diff --git a/clang-tools-extra/clang-tidy/portability/SIMDIntrinsicsCheck.cpp b/clang-tools-extra/clang-tidy/portability/SIMDIntrinsicsCheck.cpp index 8ea00a0..55ffe2d 100644 --- a/clang-tools-extra/clang-tidy/portability/SIMDIntrinsicsCheck.cpp +++ b/clang-tools-extra/clang-tidy/portability/SIMDIntrinsicsCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace portability { +namespace clang::tidy::portability { namespace { @@ -146,6 +144,4 @@ void SIMDIntrinsicsCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace portability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::portability diff --git a/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp b/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp index a95048d..b34cb01 100644 --- a/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp +++ b/clang-tools-extra/clang-tidy/portability/StdAllocatorConstCheck.cpp @@ -11,9 +11,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace portability { +namespace clang::tidy::portability { void StdAllocatorConstCheck::registerMatchers(MatchFinder *Finder) { // Match std::allocator. @@ -66,6 +64,4 @@ void StdAllocatorConstCheck::check(const MatchFinder::MatchResult &Result) { "libraries"); } -} // namespace portability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::portability diff --git a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp index 288a8e7..6906717 100644 --- a/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp +++ b/clang-tools-extra/clang-tidy/readability/AvoidConstParamsInDecls.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { SourceRange getTypeRange(const ParmVarDecl &Param) { @@ -89,6 +87,4 @@ void AvoidConstParamsInDecls::check(const MatchFinder::MatchResult &Result) { CharSourceRange::getTokenRange(Tok->getLocation(), Tok->getLocation())); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp index d6f4d92..74bb073 100644 --- a/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static tok::TokenKind getTokenKind(SourceLocation Loc, const SourceManager &SM, const ASTContext *Context) { @@ -269,6 +267,4 @@ void BracesAroundStatementsCheck::onEndOfTranslationUnit() { ForceBracesStmts.clear(); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp b/clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp index 557cb97..b63c252 100644 --- a/clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { // Finds the location of the qualifying `const` token in the `FunctionDecl`'s // return type. Returns `std::nullopt` when the return type is not @@ -157,6 +155,4 @@ void ConstReturnTypeCheck::check(const MatchFinder::MatchResult &Result) { diag(Loc, "could not transform this declaration", DiagnosticIDs::Note); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp index f99251d..970ed8b 100644 --- a/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void ContainerContainsCheck::registerMatchers(MatchFinder *Finder) { const auto SupportedContainers = hasType( @@ -137,6 +135,4 @@ void ContainerContainsCheck::check(const MatchFinder::MatchResult &Result) { CallEnd.getLocWithOffset(1), ComparisonEnd.getLocWithOffset(1))); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp index e22bad7..5a51b25 100644 --- a/clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { constexpr llvm::StringLiteral ContainerExprName = "container-expr"; constexpr llvm::StringLiteral DerefContainerExprName = "deref-container-expr"; @@ -114,6 +112,4 @@ void ContainerDataPointerCheck::check(const MatchFinder::MatchResult &Result) { "the address of the 0-th element") << Hint; } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp index 56556b5..a39b72e 100644 --- a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp @@ -90,8 +90,7 @@ AST_MATCHER(QualType, isIntegralType) { return Node->isIntegralType(Finder->getASTContext()); } } // namespace ast_matchers -namespace tidy { -namespace readability { +namespace tidy::readability { using utils::isBinaryOrTernary; @@ -328,6 +327,5 @@ void ContainerSizeEmptyCheck::check(const MatchFinder::MatchResult &Result) { << Container; } -} // namespace readability -} // namespace tidy +} // namespace tidy::readability } // namespace clang diff --git a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp index 0ff0846..0ef7d29 100644 --- a/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp +++ b/clang-tools-extra/clang-tidy/readability/ConvertMemberFunctionsToStatic.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { AST_MATCHER(CXXMethodDecl, isStatic) { return Node.isStatic(); } @@ -167,6 +165,4 @@ void ConvertMemberFunctionsToStatic::check( Diag << FixItHint::CreateInsertion(Declaration->getBeginLoc(), "static "); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/DeleteNullPointerCheck.cpp b/clang-tools-extra/clang-tidy/readability/DeleteNullPointerCheck.cpp index 9f33504..12131cc 100644 --- a/clang-tools-extra/clang-tidy/readability/DeleteNullPointerCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/DeleteNullPointerCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void DeleteNullPointerCheck::registerMatchers(MatchFinder *Finder) { const auto DeleteExpr = @@ -73,6 +71,4 @@ void DeleteNullPointerCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp b/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp index 8c69417..d1f41e0 100644 --- a/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp @@ -13,9 +13,7 @@ #include "llvm/ADT/SmallVector.h" #include -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static SourceLocation advanceBeyondCurrentLine(const SourceManager &SM, SourceLocation Start, @@ -111,6 +109,4 @@ void DuplicateIncludeCheck::registerPPCallbacks( PP->addPPCallbacks(std::make_unique(*this, SM)); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp b/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp index e60f5bf..1e85caf 100644 --- a/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -324,6 +322,4 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp index f1e252e..b5dc09c 100644 --- a/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp @@ -33,9 +33,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { struct CognitiveComplexity final { @@ -562,6 +560,4 @@ void FunctionCognitiveComplexityCheck::check( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp index 96b8123..3c80395 100644 --- a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { class FunctionASTVisitor : public RecursiveASTVisitor { @@ -221,6 +219,4 @@ void FunctionSizeCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp index 1fd8624..68da28b 100644 --- a/clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { const unsigned DefaultMinimumVariableNameLength = 3; const unsigned DefaultMinimumLoopCounterNameLength = 2; @@ -151,6 +149,4 @@ void IdentifierLengthCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp index 47a55d3..b2b2875 100644 --- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp @@ -28,8 +28,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { llvm::ArrayRef< std::pair> @@ -1451,5 +1450,4 @@ IdentifierNamingCheck::getStyleForFile(StringRef FileName) const { } } // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp index 51e3e2c..7ec63d0 100644 --- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -391,6 +389,4 @@ void ImplicitBoolConversionCheck::handleCastFromBool( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp index c43c2b5..13031e7 100644 --- a/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/InconsistentDeclarationParameterNameCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -350,6 +348,4 @@ void InconsistentDeclarationParameterNameCheck::markRedeclarationsAsVisited( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/IsolateDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/readability/IsolateDeclarationCheck.cpp index 1a4c6ff..97abf8d 100644 --- a/clang-tools-extra/clang-tidy/readability/IsolateDeclarationCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/IsolateDeclarationCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::utils::lexer; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { AST_MATCHER(DeclStmt, isSingleDecl) { return Node.isSingleDecl(); } @@ -273,6 +271,4 @@ void IsolateDeclarationCheck::check(const MatchFinder::MatchResult &Result) { Diag << FixItHint::CreateReplacement(WholeDecl->getSourceRange(), Replacement); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp b/clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp index 1d15ae1..64940ed 100644 --- a/clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp @@ -54,8 +54,7 @@ static bool isUsedToDefineABitField(const MatchFinder::MatchResult &Result, }); } -namespace tidy { -namespace readability { +namespace tidy::readability { const char DefaultIgnoredIntegerValues[] = "1;2;3;4;"; const char DefaultIgnoredFloatingPointValues[] = "1.0;100.0;"; @@ -225,6 +224,5 @@ bool MagicNumbersCheck::isBitFieldWidth( }); } -} // namespace readability -} // namespace tidy +} // namespace tidy::readability } // namespace clang diff --git a/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp b/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp index 15ab394..2d6a469 100644 --- a/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/MakeMemberFunctionConstCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { AST_MATCHER(CXXMethodDecl, isStatic) { return Node.isStatic(); } @@ -267,6 +265,4 @@ void MakeMemberFunctionConstCheck::check( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp b/clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp index 7b5a22f..4c10b6f 100644 --- a/clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/MisleadingIndentationCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static const IfStmt *getPrecedingIf(const SourceManager &SM, ASTContext *Context, const IfStmt *If) { @@ -121,6 +119,4 @@ void MisleadingIndentationCheck::check(const MatchFinder::MatchResult &Result) { missingBracesCheck(*Result.SourceManager, CStmt); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/MisplacedArrayIndexCheck.cpp b/clang-tools-extra/clang-tidy/readability/MisplacedArrayIndexCheck.cpp index 5cc4b96..328d189 100644 --- a/clang-tools-extra/clang-tidy/readability/MisplacedArrayIndexCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/MisplacedArrayIndexCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void MisplacedArrayIndexCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -52,6 +50,4 @@ void MisplacedArrayIndexCheck::check(const MatchFinder::MatchResult &Result) { ArraySubscriptE->getRHS()->getSourceRange(), LText); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp index c8a8edf..f621cfe 100644 --- a/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void NamedParameterCheck::registerMatchers(ast_matchers::MatchFinder *Finder) { Finder->addMatcher(functionDecl().bind("decl"), this); @@ -117,6 +115,4 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp index 270a527..ad2d396 100644 --- a/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NamespaceCommentCheck.cpp @@ -18,9 +18,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { NamespaceCommentCheck::NamespaceCommentCheck(StringRef Name, ClangTidyContext *Context) @@ -204,6 +202,4 @@ void NamespaceCommentCheck::check(const MatchFinder::MatchResult &Result) { << NamespaceNameForDiag; } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp index 01bcfca..974909f 100644 --- a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void NonConstParameterCheck::registerMatchers(MatchFinder *Finder) { // Add parameters to Parameters. @@ -233,6 +231,4 @@ void NonConstParameterCheck::markCanNotBeConst(const Expr *E, } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp b/clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp index 563976d..e843c59 100644 --- a/clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -286,6 +284,4 @@ void QualifiedAutoCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp index 6bbef6b..7aa0904 100644 --- a/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp @@ -52,8 +52,7 @@ #include "UppercaseLiteralSuffixCheck.h" #include "UseAnyOfAllOfCheck.h" -namespace clang { -namespace tidy { +namespace clang::tidy { namespace readability { class ReadabilityModule : public ClangTidyModule { @@ -156,5 +155,4 @@ static ClangTidyModuleRegistry::Add // and thus register the ReadabilityModule. volatile int ReadabilityModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.cpp index cf7fc03..c3464b2 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantAccessSpecifiersCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void RedundantAccessSpecifiersCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -77,6 +75,4 @@ void RedundantAccessSpecifiersCheck::check( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp index dd63de3..ed01d3a 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantControlFlowCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -91,6 +89,4 @@ void RedundantControlFlowCheck::issueDiagnostic( diag(StmtRange.getBegin(), Diag) << FixItHint::CreateRemoval(RemovedRange); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp index 78ba969..f21f0a7 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { AST_MATCHER(FunctionDecl, doesDeclarationForceExternallyVisibleDefinition) { return Node.doesDeclarationForceExternallyVisibleDefinition(); @@ -86,6 +84,4 @@ void RedundantDeclarationCheck::check(const MatchFinder::MatchResult &Result) { } diag(Prev->getLocation(), "previously declared here", DiagnosticIDs::Note); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.cpp index 1761378..247d287 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantFunctionPtrDereferenceCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void RedundantFunctionPtrDereferenceCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher( @@ -32,6 +30,4 @@ void RedundantFunctionPtrDereferenceCheck::check(const MatchFinder::MatchResult << FixItHint::CreateRemoval(Operator->getOperatorLoc()); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp index 0af9a04..b5d4077 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void RedundantMemberInitCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "IgnoreBaseInCopyConstructors", @@ -69,6 +67,4 @@ void RedundantMemberInitCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp index 0ce2cf2..513687f 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantPreprocessorCheck.cpp @@ -12,9 +12,7 @@ #include "clang/Lex/PPCallbacks.h" #include "clang/Lex/Preprocessor.h" -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { /// Information about an opening preprocessor directive. @@ -104,6 +102,4 @@ void RedundantPreprocessorCheck::registerPPCallbacks( ::std::make_unique(*this, *PP)); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp index e663f05..8837ac1 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp @@ -12,9 +12,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { internal::Matcher callToGet(const internal::Matcher &OnClass) { @@ -172,6 +170,4 @@ void RedundantSmartptrGetCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateReplacement(SR, Replacement); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp index 9ecd6d6..960d5ab 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -200,6 +198,4 @@ void RedundantStringCStrCheck::check(const MatchFinder::MatchResult &Result) { << FixItHint::CreateReplacement(Call->getSourceRange(), ArgText); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp index 3e02037..b579aaf 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantStringInitCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; using namespace clang::tidy::matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { const char DefaultStringNames[] = "::std::basic_string_view;::std::basic_string"; @@ -162,6 +160,4 @@ void RedundantStringInitCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp index 18a3bf6..07cb07f 100644 --- a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -957,6 +955,4 @@ bool SimplifyBooleanExprCheck::reportDeMorgan(const ASTContext &Context, Diag << Fixes; return true; } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp b/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp index d77b436..d274abc 100644 --- a/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static const char KDefaultTypes[] = "::std::basic_string;::std::basic_string_view;::std::vector;::std::array"; @@ -66,6 +64,4 @@ void SimplifySubscriptExprCheck::storeOptions( Options.store(Opts, "Types", utils::options::serializeStringList(Types)); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp b/clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp index 0f73b13..b23b67e 100644 --- a/clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static unsigned getNameSpecifierNestingLevel(const QualType &QType) { if (const ElaboratedType *ElType = QType->getAs()) { @@ -94,6 +92,4 @@ void StaticAccessedThroughInstanceCheck::check( BaseTypeName + "::"); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp index ffd1238..3e6bb01 100644 --- a/clang-tools-extra/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/StaticDefinitionInAnonymousNamespaceCheck.cpp @@ -13,9 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void StaticDefinitionInAnonymousNamespaceCheck::registerMatchers( MatchFinder *Finder) { @@ -60,6 +58,4 @@ void StaticDefinitionInAnonymousNamespaceCheck::check( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/StringCompareCheck.cpp b/clang-tools-extra/clang-tidy/readability/StringCompareCheck.cpp index d3cf27d..3b5d89c 100644 --- a/clang-tools-extra/clang-tidy/readability/StringCompareCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/StringCompareCheck.cpp @@ -14,9 +14,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { static const StringRef CompareMessage = "do not use 'compare' to test equality " "of strings; use the string equality " @@ -75,6 +73,4 @@ void StringCompareCheck::check(const MatchFinder::MatchResult &Result) { // FIXME: Add fixit to fix the code for case one and two (match1). } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp index 3972dc3..7fe0c09 100644 --- a/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; namespace optutils = clang::tidy::utils::options; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { struct DefaultHeuristicConfiguration { @@ -807,6 +805,4 @@ bool SuspiciousCallArgumentCheck::areNamesSimilar(StringRef Arg, llvm_unreachable("Unhandled heuristic kind"); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp index 23f8dbb..462085b 100644 --- a/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp @@ -15,9 +15,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { void UniqueptrDeleteReleaseCheck::storeOptions( ClangTidyOptions::OptionMap &Opts) { @@ -81,6 +79,4 @@ void UniqueptrDeleteReleaseCheck::check( } } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp b/clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp index e665bcd..549331c 100644 --- a/clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/UppercaseLiteralSuffixCheck.cpp @@ -17,9 +17,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace readability { +namespace clang::tidy::readability { namespace { @@ -241,6 +239,4 @@ void UppercaseLiteralSuffixCheck::check( checkBoundMatch(Result); } -} // namespace readability -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::readability diff --git a/clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp b/clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp index 564e2ca..7cf0e08 100644 --- a/clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/UseAnyOfAllOfCheck.cpp @@ -37,8 +37,7 @@ AST_MATCHER_P(Stmt, nextStmt, ast_matchers::internal::Matcher, } } // namespace -namespace tidy { -namespace readability { +namespace tidy::readability { void UseAnyOfAllOfCheck::registerMatchers(MatchFinder *Finder) { auto Returns = [](bool V) { @@ -104,6 +103,5 @@ void UseAnyOfAllOfCheck::check(const MatchFinder::MatchResult &Result) { } } -} // namespace readability -} // namespace tidy +} // namespace tidy::readability } // namespace clang diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py index 4bb9af8..ab37007 100755 --- a/clang-tools-extra/clang-tidy/rename_check.py +++ b/clang-tools-extra/clang-tidy/rename_check.py @@ -308,8 +308,9 @@ def main(): for filename in check_implementation_files: # Move check implementation to the directory of the new module. filename = fileRename(filename, old_module_path, new_module_path) - replaceInFileRegex(filename, 'namespace ' + old_module + '[^ \n]*', - 'namespace ' + new_namespace) + replaceInFileRegex(filename, + 'namespace clang::tidy::' + old_module + '[^ \n]*', + 'namespace clang::tidy::' + new_namespace) if (args.old_check_name == args.new_check_name): return diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 3ff4cbd..765b848 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -263,8 +263,7 @@ option is recognized. )"), cl::init(false), cl::cat(ClangTidyCategory)); -namespace clang { -namespace tidy { +namespace clang::tidy { static void printStats(const ClangTidyStats &Stats) { if (Stats.errorsIgnored()) { @@ -660,5 +659,4 @@ int clangTidyMain(int argc, const char **argv) { return 0; } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/utils/ASTUtils.cpp b/clang-tools-extra/clang-tidy/utils/ASTUtils.cpp index b226e25..9fda73e 100644 --- a/clang-tools-extra/clang-tidy/utils/ASTUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/ASTUtils.cpp @@ -12,9 +12,7 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { using namespace ast_matchers; const FunctionDecl *getSurroundingFunction(ASTContext &Context, @@ -90,6 +88,4 @@ bool rangeCanBeFixed(SourceRange Range, const SourceManager *SM) { !utils::rangeContainsMacroExpansion(Range, SM); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/Aliasing.cpp b/clang-tools-extra/clang-tidy/utils/Aliasing.cpp index c272453..2facf06 100644 --- a/clang-tools-extra/clang-tidy/utils/Aliasing.cpp +++ b/clang-tools-extra/clang-tidy/utils/Aliasing.cpp @@ -11,9 +11,7 @@ #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { /// Return whether \p S is a reference to the declaration of \p Var. static bool isAccessForVar(const Stmt *S, const VarDecl *Var) { @@ -96,6 +94,4 @@ bool hasPtrOrReferenceInFunc(const Decl *Func, const VarDecl *Var) { refersToEnclosingLambdaCaptureByRef(Func, Var); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp b/clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp index 2df0461..8915299 100644 --- a/clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp @@ -12,10 +12,7 @@ #include "clang/AST/DeclCXX.h" #include "clang/ASTMatchers/ASTMatchFinder.h" -namespace clang { -namespace tidy { -namespace utils { -namespace decl_ref_expr { +namespace clang::tidy::utils::decl_ref_expr { using namespace ::clang::ast_matchers; using llvm::SmallPtrSet; @@ -146,7 +143,4 @@ bool isCopyAssignmentArgument(const DeclRefExpr &DeclRef, const Decl &Decl, return !Matches.empty(); } -} // namespace decl_ref_expr -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils::decl_ref_expr diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp index 1f22c1d..359e7e9 100644 --- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp +++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp @@ -8,9 +8,7 @@ #include "ExceptionAnalyzer.h" -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { void ExceptionAnalyzer::ExceptionInfo::registerException( const Type *ExceptionType) { @@ -274,7 +272,4 @@ ExceptionAnalyzer::analyze(const Stmt *Stmt) { return analyzeDispatch(Stmt); } -} // namespace utils -} // namespace tidy - -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp b/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp index ae10be6..beb4c44 100644 --- a/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp +++ b/clang-tools-extra/clang-tidy/utils/ExprSequence.cpp @@ -10,9 +10,7 @@ #include "clang/AST/ParentMapContext.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { // Returns the Stmt nodes that are parents of 'S', skipping any potential // intermediate non-Stmt nodes. @@ -206,6 +204,4 @@ const CFGBlock *StmtToBlockMap::blockContainingStmt(const Stmt *S) const { return Map.lookup(S); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp b/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp index 4e01409..e884428 100644 --- a/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp @@ -11,9 +11,7 @@ #include "llvm/Support/Path.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { bool isExpansionLocInHeaderFile(SourceLocation Loc, const SourceManager &SM, const FileExtensionsSet &HeaderFileExtensions) { @@ -70,6 +68,4 @@ bool isFileExtension(StringRef FileName, return getFileExtension(FileName, FileExtensions).has_value(); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp b/clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp index 62ba137..4f11c9b 100644 --- a/clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp @@ -12,10 +12,7 @@ #include "clang/AST/Type.h" #include -namespace clang { -namespace tidy { -namespace utils { -namespace fixit { +namespace clang::tidy::utils::fixit { FixItHint changeVarDeclToReference(const VarDecl &Var, ASTContext &Context) { SourceLocation AmpLocation = Var.getLocation(); @@ -224,7 +221,4 @@ std::optional addQualifierToVarDecl(const VarDecl &Var, return std::nullopt; } -} // namespace fixit -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils::fixit diff --git a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp index c5d5004..46c36d6 100644 --- a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp +++ b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp @@ -13,9 +13,7 @@ #include "clang/Tooling/Tooling.h" #include "llvm/Support/Path.h" -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { /// canonicalize a path by removing ./ and ../ components. static std::string cleanPath(StringRef Path) { @@ -298,6 +296,4 @@ bool HeaderGuardCheck::shouldSuggestToAddHeaderGuard(StringRef FileName) { std::string HeaderGuardCheck::formatEndIf(StringRef HeaderGuard) { return "endif // " + HeaderGuard.str(); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp index 58afc47f..d0b7474 100644 --- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp +++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp @@ -12,9 +12,7 @@ #include "clang/Lex/Token.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { class IncludeInserterCallback : public PPCallbacks { public: @@ -99,6 +97,4 @@ void IncludeInserter::addInclude(StringRef FileName, bool IsAngled, getOrCreate(FileID).addInclude(FileName, IsAngled, HashLocation, EndLocation); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp index 1ce110e..95dbdbb 100644 --- a/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp +++ b/clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp @@ -12,8 +12,7 @@ #include #include -namespace clang { -namespace tidy { +namespace clang::tidy { namespace utils { namespace { @@ -233,5 +232,4 @@ OptionEnumMapping::getEnumMapping() { {utils::IncludeSorter::IS_Google_ObjC, "google-objc"}}; return ArrayRef(Mapping); } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/utils/LexerUtils.cpp b/clang-tools-extra/clang-tidy/utils/LexerUtils.cpp index 413ca68..4971896 100644 --- a/clang-tools-extra/clang-tidy/utils/LexerUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/LexerUtils.cpp @@ -11,10 +11,7 @@ #include "clang/Basic/SourceManager.h" #include -namespace clang { -namespace tidy { -namespace utils { -namespace lexer { +namespace clang::tidy::utils::lexer { Token getPreviousToken(SourceLocation Location, const SourceManager &SM, const LangOptions &LangOpts, bool SkipComments) { @@ -215,7 +212,4 @@ SourceLocation getUnifiedEndLoc(const Stmt &S, const SourceManager &SM, return S.getEndLoc(); } -} // namespace lexer -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils::lexer diff --git a/clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp b/clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp index 9356123..4703ce1 100644 --- a/clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp +++ b/clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp @@ -13,9 +13,7 @@ #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { using namespace ast_matchers; @@ -92,6 +90,4 @@ std::string NamespaceAliaser::getNamespaceName(ASTContext &Context, return Namespace.str(); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp b/clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp index b443aac..1866ea3 100644 --- a/clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp +++ b/clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp @@ -9,10 +9,7 @@ #include "OptionsUtils.h" #include "llvm/ADT/StringExtras.h" -namespace clang { -namespace tidy { -namespace utils { -namespace options { +namespace clang::tidy::utils::options { static const char StringsDelimiter[] = ";"; @@ -63,7 +60,4 @@ std::string serializeStringList(ArrayRef Strings) { return llvm::join(Strings, StringsDelimiter); } -} // namespace options -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils::options diff --git a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp index e3c22c3..160910b 100644 --- a/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp @@ -59,8 +59,7 @@ struct DenseMapInfo { } // namespace llvm -namespace clang { -namespace tidy { +namespace clang::tidy { namespace { @@ -563,5 +562,4 @@ void RenamerClangTidyCheck::onEndOfTranslationUnit() { } } -} // namespace tidy -} // namespace clang +} // namespace clang::tidy diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp index f69be2f..dcdbcd3 100644 --- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp @@ -12,9 +12,7 @@ #include "llvm/ADT/STLExtras.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { using transformer::RewriteRuleWith; #ifndef NDEBUG @@ -157,6 +155,4 @@ void TransformerClangTidyCheck::storeOptions( Options.store(Opts, "IncludeStyle", Inserter.getStyle()); } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp b/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp index 0dbbd52..270b438 100644 --- a/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp +++ b/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp @@ -12,10 +12,7 @@ #include "clang/ASTMatchers/ASTMatchFinder.h" #include -namespace clang { -namespace tidy { -namespace utils { -namespace type_traits { +namespace clang::tidy::utils::type_traits { namespace { @@ -162,7 +159,4 @@ bool hasNonTrivialMoveAssignment(QualType Type) { Record->hasNonTrivialMoveAssignment(); } -} // namespace type_traits -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils::type_traits diff --git a/clang-tools-extra/clang-tidy/utils/UsingInserter.cpp b/clang-tools-extra/clang-tidy/utils/UsingInserter.cpp index 22bef9a..d9e0f3f 100644 --- a/clang-tools-extra/clang-tidy/utils/UsingInserter.cpp +++ b/clang-tools-extra/clang-tidy/utils/UsingInserter.cpp @@ -14,9 +14,7 @@ #include "clang/Lex/Lexer.h" #include -namespace clang { -namespace tidy { -namespace utils { +namespace clang::tidy::utils { using namespace ast_matchers; @@ -84,6 +82,4 @@ StringRef UsingInserter::getShortName(ASTContext &Context, return QualifiedName; } -} // namespace utils -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::utils diff --git a/clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.cpp b/clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.cpp index b75ab9d..240bb4e 100644 --- a/clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.cpp +++ b/clang-tools-extra/clang-tidy/zircon/TemporaryObjectsCheck.cpp @@ -16,9 +16,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { -namespace zircon { +namespace clang::tidy::zircon { AST_MATCHER_P(CXXRecordDecl, matchesAnyName, ArrayRef, Names) { std::string QualifiedName = Node.getQualifiedNameAsString(); @@ -54,6 +52,4 @@ void TemporaryObjectsCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "Names", utils::options::serializeStringList(Names)); } -} // namespace zircon -} // namespace tidy -} // namespace clang +} // namespace clang::tidy::zircon diff --git a/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp b/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp index 94bbd27..0006804 100644 --- a/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/zircon/ZirconTidyModule.cpp @@ -13,8 +13,7 @@ using namespace clang::ast_matchers; -namespace clang { -namespace tidy { +namespace clang::tidy { namespace zircon { /// This module is for Zircon-specific checks. @@ -35,5 +34,4 @@ static ClangTidyModuleRegistry::Add // and thus register the ZirconModule. volatile int ZirconModuleAnchorSource = 0; -} // namespace tidy -} // namespace clang +} // namespace clang::tidy -- 2.7.4