├── .arcconfig
├── .gitignore
├── CMakeLists.txt
├── CODE_OWNERS.TXT
├── LICENSE.TXT
├── README.txt
├── clang-apply-replacements
├── CMakeLists.txt
├── include
│ └── clang-apply-replacements
│ │ └── Tooling
│ │ └── ApplyReplacements.h
├── lib
│ └── Tooling
│ │ └── ApplyReplacements.cpp
└── tool
│ ├── CMakeLists.txt
│ └── ClangApplyReplacementsMain.cpp
├── clang-change-namespace
├── CMakeLists.txt
├── ChangeNamespace.cpp
├── ChangeNamespace.h
└── tool
│ ├── CMakeLists.txt
│ └── ClangChangeNamespace.cpp
├── clang-doc
├── BitcodeReader.cpp
├── BitcodeReader.h
├── BitcodeWriter.cpp
├── BitcodeWriter.h
├── CMakeLists.txt
├── ClangDoc.cpp
├── ClangDoc.h
├── Generators.cpp
├── Generators.h
├── MDGenerator.cpp
├── Mapper.cpp
├── Mapper.h
├── Representation.cpp
├── Representation.h
├── Serialize.cpp
├── Serialize.h
├── YAMLGenerator.cpp
└── tool
│ ├── CMakeLists.txt
│ └── ClangDocMain.cpp
├── clang-include-fixer
├── CMakeLists.txt
├── FuzzySymbolIndex.cpp
├── FuzzySymbolIndex.h
├── InMemorySymbolIndex.cpp
├── InMemorySymbolIndex.h
├── IncludeFixer.cpp
├── IncludeFixer.h
├── IncludeFixerContext.cpp
├── IncludeFixerContext.h
├── SymbolIndex.h
├── SymbolIndexManager.cpp
├── SymbolIndexManager.h
├── YamlSymbolIndex.cpp
├── YamlSymbolIndex.h
├── find-all-symbols
│ ├── CMakeLists.txt
│ ├── FindAllMacros.cpp
│ ├── FindAllMacros.h
│ ├── FindAllSymbols.cpp
│ ├── FindAllSymbols.h
│ ├── FindAllSymbolsAction.cpp
│ ├── FindAllSymbolsAction.h
│ ├── HeaderMapCollector.cpp
│ ├── HeaderMapCollector.h
│ ├── PathConfig.cpp
│ ├── PathConfig.h
│ ├── PragmaCommentHandler.cpp
│ ├── PragmaCommentHandler.h
│ ├── STLPostfixHeaderMap.cpp
│ ├── STLPostfixHeaderMap.h
│ ├── SymbolInfo.cpp
│ ├── SymbolInfo.h
│ ├── SymbolReporter.h
│ └── tool
│ │ ├── CMakeLists.txt
│ │ ├── FindAllSymbolsMain.cpp
│ │ └── run-find-all-symbols.py
├── plugin
│ ├── CMakeLists.txt
│ └── IncludeFixerPlugin.cpp
└── tool
│ ├── CMakeLists.txt
│ ├── ClangIncludeFixer.cpp
│ ├── clang-include-fixer-test.el
│ ├── clang-include-fixer.el
│ └── clang-include-fixer.py
├── clang-move
├── CMakeLists.txt
├── HelperDeclRefGraph.cpp
├── HelperDeclRefGraph.h
├── Move.cpp
├── Move.h
└── tool
│ ├── CMakeLists.txt
│ └── ClangMove.cpp
├── clang-query
├── CMakeLists.txt
├── Query.cpp
├── Query.h
├── QueryParser.cpp
├── QueryParser.h
├── QuerySession.h
└── tool
│ ├── CMakeLists.txt
│ └── ClangQuery.cpp
├── clang-reorder-fields
├── CMakeLists.txt
├── ReorderFieldsAction.cpp
├── ReorderFieldsAction.h
└── tool
│ ├── CMakeLists.txt
│ └── ClangReorderFields.cpp
├── clang-tidy-vs
├── .gitignore
├── CMakeLists.txt
├── ClangTidy.sln
├── ClangTidy
│ ├── CategoryVerb.cs
│ ├── CheckDatabase.cs
│ ├── CheckTree.cs
│ ├── ClangTidy.csproj
│ ├── ClangTidy.vsct
│ ├── ClangTidyCheckAttribute.cs
│ ├── ClangTidyConfigParser.cs
│ ├── ClangTidyConfigurationPage.cs
│ ├── ClangTidyPackage.cs
│ ├── ClangTidyProperties.cs
│ ├── ClangTidyPropertyGrid.Designer.cs
│ ├── ClangTidyPropertyGrid.cs
│ ├── ClangTidyPropertyGrid.resx
│ ├── DynamicPropertyComponent.Designer.cs
│ ├── DynamicPropertyComponent.cs
│ ├── DynamicPropertyConverter.cs
│ ├── DynamicPropertyDescriptor.cs
│ ├── ForwardingPropertyDescriptor.cs
│ ├── GlobalSuppressions.cs
│ ├── Guids.cs
│ ├── PkgCmdID.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Resources
│ │ ├── ClangTidyChecks.yaml
│ │ ├── Images_32bit.bmp
│ │ └── Package.ico
│ ├── Utility.cs
│ ├── VSPackage.resx
│ ├── license.txt
│ ├── packages.config
│ └── source.extension.vsixmanifest
├── README.txt
└── source.extension.vsixmanifest.in
├── clang-tidy
├── CMakeLists.txt
├── ClangTidy.cpp
├── ClangTidy.h
├── ClangTidyCheck.cpp
├── ClangTidyCheck.h
├── ClangTidyDiagnosticConsumer.cpp
├── ClangTidyDiagnosticConsumer.h
├── ClangTidyForceLinker.h
├── ClangTidyModule.cpp
├── ClangTidyModule.h
├── ClangTidyModuleRegistry.h
├── ClangTidyOptions.cpp
├── ClangTidyOptions.h
├── ClangTidyProfiling.cpp
├── ClangTidyProfiling.h
├── ExpandModularHeadersPPCallbacks.cpp
├── ExpandModularHeadersPPCallbacks.h
├── abseil
│ ├── AbseilMatcher.h
│ ├── AbseilTidyModule.cpp
│ ├── CMakeLists.txt
│ ├── DurationAdditionCheck.cpp
│ ├── DurationAdditionCheck.h
│ ├── DurationComparisonCheck.cpp
│ ├── DurationComparisonCheck.h
│ ├── DurationConversionCastCheck.cpp
│ ├── DurationConversionCastCheck.h
│ ├── DurationDivisionCheck.cpp
│ ├── DurationDivisionCheck.h
│ ├── DurationFactoryFloatCheck.cpp
│ ├── DurationFactoryFloatCheck.h
│ ├── DurationFactoryScaleCheck.cpp
│ ├── DurationFactoryScaleCheck.h
│ ├── DurationRewriter.cpp
│ ├── DurationRewriter.h
│ ├── DurationSubtractionCheck.cpp
│ ├── DurationSubtractionCheck.h
│ ├── DurationUnnecessaryConversionCheck.cpp
│ ├── DurationUnnecessaryConversionCheck.h
│ ├── FasterStrsplitDelimiterCheck.cpp
│ ├── FasterStrsplitDelimiterCheck.h
│ ├── NoInternalDependenciesCheck.cpp
│ ├── NoInternalDependenciesCheck.h
│ ├── NoNamespaceCheck.cpp
│ ├── NoNamespaceCheck.h
│ ├── RedundantStrcatCallsCheck.cpp
│ ├── RedundantStrcatCallsCheck.h
│ ├── StrCatAppendCheck.cpp
│ ├── StrCatAppendCheck.h
│ ├── StringFindStartswithCheck.cpp
│ ├── StringFindStartswithCheck.h
│ ├── TimeComparisonCheck.cpp
│ ├── TimeComparisonCheck.h
│ ├── TimeSubtractionCheck.cpp
│ ├── TimeSubtractionCheck.h
│ ├── UpgradeDurationConversionsCheck.cpp
│ └── UpgradeDurationConversionsCheck.h
├── add_new_check.py
├── android
│ ├── AndroidTidyModule.cpp
│ ├── CMakeLists.txt
│ ├── CloexecAccept4Check.cpp
│ ├── CloexecAccept4Check.h
│ ├── CloexecAcceptCheck.cpp
│ ├── CloexecAcceptCheck.h
│ ├── CloexecCheck.cpp
│ ├── CloexecCheck.h
│ ├── CloexecCreatCheck.cpp
│ ├── CloexecCreatCheck.h
│ ├── CloexecDupCheck.cpp
│ ├── CloexecDupCheck.h
│ ├── CloexecEpollCreate1Check.cpp
│ ├── CloexecEpollCreate1Check.h
│ ├── CloexecEpollCreateCheck.cpp
│ ├── CloexecEpollCreateCheck.h
│ ├── CloexecFopenCheck.cpp
│ ├── CloexecFopenCheck.h
│ ├── CloexecInotifyInit1Check.cpp
│ ├── CloexecInotifyInit1Check.h
│ ├── CloexecInotifyInitCheck.cpp
│ ├── CloexecInotifyInitCheck.h
│ ├── CloexecMemfdCreateCheck.cpp
│ ├── CloexecMemfdCreateCheck.h
│ ├── CloexecOpenCheck.cpp
│ ├── CloexecOpenCheck.h
│ ├── CloexecPipe2Check.cpp
│ ├── CloexecPipe2Check.h
│ ├── CloexecPipeCheck.cpp
│ ├── CloexecPipeCheck.h
│ ├── CloexecSocketCheck.cpp
│ ├── CloexecSocketCheck.h
│ ├── ComparisonInTempFailureRetryCheck.cpp
│ └── ComparisonInTempFailureRetryCheck.h
├── boost
│ ├── BoostTidyModule.cpp
│ ├── CMakeLists.txt
│ ├── UseToStringCheck.cpp
│ └── UseToStringCheck.h
├── bugprone
│ ├── ArgumentCommentCheck.cpp
│ ├── ArgumentCommentCheck.h
│ ├── AssertSideEffectCheck.cpp
│ ├── AssertSideEffectCheck.h
│ ├── BoolPointerImplicitConversionCheck.cpp
│ ├── BoolPointerImplicitConversionCheck.h
│ ├── BranchCloneCheck.cpp
│ ├── BranchCloneCheck.h
│ ├── BugproneTidyModule.cpp
│ ├── CMakeLists.txt
│ ├── CopyConstructorInitCheck.cpp
│ ├── CopyConstructorInitCheck.h
│ ├── DanglingHandleCheck.cpp
│ ├── DanglingHandleCheck.h
│ ├── ExceptionEscapeCheck.cpp
│ ├── ExceptionEscapeCheck.h
│ ├── FoldInitTypeCheck.cpp
│ ├── FoldInitTypeCheck.h
│ ├── ForwardDeclarationNamespaceCheck.cpp
│ ├── ForwardDeclarationNamespaceCheck.h
│ ├── ForwardingReferenceOverloadCheck.cpp
│ ├── ForwardingReferenceOverloadCheck.h
│ ├── InaccurateEraseCheck.cpp
│ ├── InaccurateEraseCheck.h
│ ├── IncorrectRoundingsCheck.cpp
│ ├── IncorrectRoundingsCheck.h
│ ├── IntegerDivisionCheck.cpp
│ ├── IntegerDivisionCheck.h
│ ├── LambdaFunctionNameCheck.cpp
│ ├── LambdaFunctionNameCheck.h
│ ├── MacroParenthesesCheck.cpp
│ ├── MacroParenthesesCheck.h
│ ├── MacroRepeatedSideEffectsCheck.cpp
│ ├── MacroRepeatedSideEffectsCheck.h
│ ├── MisplacedOperatorInStrlenInAllocCheck.cpp
│ ├── MisplacedOperatorInStrlenInAllocCheck.h
│ ├── MisplacedWideningCastCheck.cpp
│ ├── MisplacedWideningCastCheck.h
│ ├── MoveForwardingReferenceCheck.cpp
│ ├── MoveForwardingReferenceCheck.h
│ ├── MultipleStatementMacroCheck.cpp
│ ├── MultipleStatementMacroCheck.h
│ ├── ParentVirtualCallCheck.cpp
│ ├── ParentVirtualCallCheck.h
│ ├── SizeofContainerCheck.cpp
│ ├── SizeofContainerCheck.h
│ ├── SizeofExpressionCheck.cpp
│ ├── SizeofExpressionCheck.h
│ ├── StringConstructorCheck.cpp
│ ├── StringConstructorCheck.h
│ ├── StringIntegerAssignmentCheck.cpp
│ ├── StringIntegerAssignmentCheck.h
│ ├── StringLiteralWithEmbeddedNulCheck.cpp
│ ├── StringLiteralWithEmbeddedNulCheck.h
│ ├── SuspiciousEnumUsageCheck.cpp
│ ├── SuspiciousEnumUsageCheck.h
│ ├── SuspiciousMemsetUsageCheck.cpp
│ ├── SuspiciousMemsetUsageCheck.h
│ ├── SuspiciousMissingCommaCheck.cpp
│ ├── SuspiciousMissingCommaCheck.h
│ ├── SuspiciousSemicolonCheck.cpp
│ ├── SuspiciousSemicolonCheck.h
│ ├── SuspiciousStringCompareCheck.cpp
│ ├── SuspiciousStringCompareCheck.h
│ ├── SwappedArgumentsCheck.cpp
│ ├── SwappedArgumentsCheck.h
│ ├── TerminatingContinueCheck.cpp
│ ├── TerminatingContinueCheck.h
│ ├── ThrowKeywordMissingCheck.cpp
│ ├── ThrowKeywordMissingCheck.h
│ ├── TooSmallLoopVariableCheck.cpp
│ ├── TooSmallLoopVariableCheck.h
│ ├── UndefinedMemoryManipulationCheck.cpp
│ ├── UndefinedMemoryManipulationCheck.h
│ ├── UndelegatedConstructorCheck.cpp
│ ├── UndelegatedConstructorCheck.h
│ ├── UnhandledSelfAssignmentCheck.cpp
│ ├── UnhandledSelfAssignmentCheck.h
│ ├── UnusedRaiiCheck.cpp
│ ├── UnusedRaiiCheck.h
│ ├── UnusedReturnValueCheck.cpp
│ ├── UnusedReturnValueCheck.h
│ ├── UseAfterMoveCheck.cpp
│ ├── UseAfterMoveCheck.h
│ ├── VirtualNearMissCheck.cpp
│ └── VirtualNearMissCheck.h
├── cert
│ ├── CERTTidyModule.cpp
│ ├── CMakeLists.txt
│ ├── CommandProcessorCheck.cpp
│ ├── CommandProcessorCheck.h
│ ├── DontModifyStdNamespaceCheck.cpp
│ ├── DontModifyStdNamespaceCheck.h
│ ├── FloatLoopCounter.cpp
│ ├── FloatLoopCounter.h
│ ├── LICENSE.TXT
│ ├── LimitedRandomnessCheck.cpp
│ ├── LimitedRandomnessCheck.h
│ ├── PostfixOperatorCheck.cpp
│ ├── PostfixOperatorCheck.h
│ ├── ProperlySeededRandomGeneratorCheck.cpp
│ ├── ProperlySeededRandomGeneratorCheck.h
│ ├── SetLongJmpCheck.cpp
│ ├── SetLongJmpCheck.h
│ ├── StaticObjectExceptionCheck.cpp
│ ├── StaticObjectExceptionCheck.h
│ ├── StrToNumCheck.cpp
│ ├── StrToNumCheck.h
│ ├── ThrownExceptionTypeCheck.cpp
│ ├── ThrownExceptionTypeCheck.h
│ ├── VariadicFunctionDefCheck.cpp
│ └── VariadicFunctionDefCheck.h
├── cppcoreguidelines
│ ├── AvoidGotoCheck.cpp
│ ├── AvoidGotoCheck.h
│ ├── CMakeLists.txt
│ ├── CppCoreGuidelinesTidyModule.cpp
│ ├── InterfacesGlobalInitCheck.cpp
│ ├── InterfacesGlobalInitCheck.h
│ ├── MacroUsageCheck.cpp
│ ├── MacroUsageCheck.h
│ ├── NarrowingConversionsCheck.cpp
│ ├── NarrowingConversionsCheck.h
│ ├── NoMallocCheck.cpp
│ ├── NoMallocCheck.h
│ ├── OwningMemoryCheck.cpp
│ ├── OwningMemoryCheck.h
│ ├── ProBoundsArrayToPointerDecayCheck.cpp
│ ├── ProBoundsArrayToPointerDecayCheck.h
│ ├── ProBoundsConstantArrayIndexCheck.cpp
│ ├── ProBoundsConstantArrayIndexCheck.h
│ ├── ProBoundsPointerArithmeticCheck.cpp
│ ├── ProBoundsPointerArithmeticCheck.h
│ ├── ProTypeConstCastCheck.cpp
│ ├── ProTypeConstCastCheck.h
│ ├── ProTypeCstyleCastCheck.cpp
│ ├── ProTypeCstyleCastCheck.h
│ ├── ProTypeMemberInitCheck.cpp
│ ├── ProTypeMemberInitCheck.h
│ ├── ProTypeReinterpretCastCheck.cpp
│ ├── ProTypeReinterpretCastCheck.h
│ ├── ProTypeStaticCastDowncastCheck.cpp
│ ├── ProTypeStaticCastDowncastCheck.h
│ ├── ProTypeUnionAccessCheck.cpp
│ ├── ProTypeUnionAccessCheck.h
│ ├── ProTypeVarargCheck.cpp
│ ├── ProTypeVarargCheck.h
│ ├── SlicingCheck.cpp
│ ├── SlicingCheck.h
│ ├── SpecialMemberFunctionsCheck.cpp
│ └── SpecialMemberFunctionsCheck.h
├── fuchsia
│ ├── CMakeLists.txt
│ ├── DefaultArgumentsCallsCheck.cpp
│ ├── DefaultArgumentsCallsCheck.h
│ ├── DefaultArgumentsDeclarationsCheck.cpp
│ ├── DefaultArgumentsDeclarationsCheck.h
│ ├── FuchsiaTidyModule.cpp
│ ├── MultipleInheritanceCheck.cpp
│ ├── MultipleInheritanceCheck.h
│ ├── OverloadedOperatorCheck.cpp
│ ├── OverloadedOperatorCheck.h
│ ├── RestrictSystemIncludesCheck.cpp
│ ├── RestrictSystemIncludesCheck.h
│ ├── StaticallyConstructedObjectsCheck.cpp
│ ├── StaticallyConstructedObjectsCheck.h
│ ├── TrailingReturnCheck.cpp
│ ├── TrailingReturnCheck.h
│ ├── VirtualInheritanceCheck.cpp
│ └── VirtualInheritanceCheck.h
├── google
│ ├── AvoidCStyleCastsCheck.cpp
│ ├── AvoidCStyleCastsCheck.h
│ ├── AvoidNSObjectNewCheck.cpp
│ ├── AvoidNSObjectNewCheck.h
│ ├── AvoidThrowingObjCExceptionCheck.cpp
│ ├── AvoidThrowingObjCExceptionCheck.h
│ ├── AvoidUnderscoreInGoogletestNameCheck.cpp
│ ├── AvoidUnderscoreInGoogletestNameCheck.h
│ ├── CMakeLists.txt
│ ├── DefaultArgumentsCheck.cpp
│ ├── DefaultArgumentsCheck.h
│ ├── ExplicitConstructorCheck.cpp
│ ├── ExplicitConstructorCheck.h
│ ├── ExplicitMakePairCheck.cpp
│ ├── ExplicitMakePairCheck.h
│ ├── FunctionNamingCheck.cpp
│ ├── FunctionNamingCheck.h
│ ├── GlobalNamesInHeadersCheck.cpp
│ ├── GlobalNamesInHeadersCheck.h
│ ├── GlobalVariableDeclarationCheck.cpp
│ ├── GlobalVariableDeclarationCheck.h
│ ├── GoogleTidyModule.cpp
│ ├── IntegerTypesCheck.cpp
│ ├── IntegerTypesCheck.h
│ ├── NonConstReferences.cpp
│ ├── NonConstReferences.h
│ ├── OverloadedUnaryAndCheck.cpp
│ ├── OverloadedUnaryAndCheck.h
│ ├── TodoCommentCheck.cpp
│ ├── TodoCommentCheck.h
│ ├── UnnamedNamespaceInHeaderCheck.cpp
│ ├── UnnamedNamespaceInHeaderCheck.h
│ ├── UsingNamespaceDirectiveCheck.cpp
│ └── UsingNamespaceDirectiveCheck.h
├── hicpp
│ ├── CMakeLists.txt
│ ├── ExceptionBaseclassCheck.cpp
│ ├── ExceptionBaseclassCheck.h
│ ├── HICPPTidyModule.cpp
│ ├── LICENSE.TXT
│ ├── MultiwayPathsCoveredCheck.cpp
│ ├── MultiwayPathsCoveredCheck.h
│ ├── NoAssemblerCheck.cpp
│ ├── NoAssemblerCheck.h
│ ├── SignedBitwiseCheck.cpp
│ └── SignedBitwiseCheck.h
├── llvm
│ ├── CMakeLists.txt
│ ├── HeaderGuardCheck.cpp
│ ├── HeaderGuardCheck.h
│ ├── IncludeOrderCheck.cpp
│ ├── IncludeOrderCheck.h
│ ├── LLVMTidyModule.cpp
│ ├── PreferIsaOrDynCastInConditionalsCheck.cpp
│ ├── PreferIsaOrDynCastInConditionalsCheck.h
│ ├── TwineLocalCheck.cpp
│ └── TwineLocalCheck.h
├── misc
│ ├── CMakeLists.txt
│ ├── DefinitionsInHeadersCheck.cpp
│ ├── DefinitionsInHeadersCheck.h
│ ├── MiscTidyModule.cpp
│ ├── MisplacedConstCheck.cpp
│ ├── MisplacedConstCheck.h
│ ├── NewDeleteOverloadsCheck.cpp
│ ├── NewDeleteOverloadsCheck.h
│ ├── NonCopyableObjects.cpp
│ ├── NonCopyableObjects.h
│ ├── NonPrivateMemberVariablesInClassesCheck.cpp
│ ├── NonPrivateMemberVariablesInClassesCheck.h
│ ├── RedundantExpressionCheck.cpp
│ ├── RedundantExpressionCheck.h
│ ├── StaticAssertCheck.cpp
│ ├── StaticAssertCheck.h
│ ├── ThrowByValueCatchByReferenceCheck.cpp
│ ├── ThrowByValueCatchByReferenceCheck.h
│ ├── UnconventionalAssignOperatorCheck.cpp
│ ├── UnconventionalAssignOperatorCheck.h
│ ├── UniqueptrResetReleaseCheck.cpp
│ ├── UniqueptrResetReleaseCheck.h
│ ├── UnusedAliasDeclsCheck.cpp
│ ├── UnusedAliasDeclsCheck.h
│ ├── UnusedParametersCheck.cpp
│ ├── UnusedParametersCheck.h
│ ├── UnusedUsingDeclsCheck.cpp
│ └── UnusedUsingDeclsCheck.h
├── modernize
│ ├── AvoidBindCheck.cpp
│ ├── AvoidBindCheck.h
│ ├── AvoidCArraysCheck.cpp
│ ├── AvoidCArraysCheck.h
│ ├── CMakeLists.txt
│ ├── ConcatNestedNamespacesCheck.cpp
│ ├── ConcatNestedNamespacesCheck.h
│ ├── DeprecatedHeadersCheck.cpp
│ ├── DeprecatedHeadersCheck.h
│ ├── DeprecatedIosBaseAliasesCheck.cpp
│ ├── DeprecatedIosBaseAliasesCheck.h
│ ├── LoopConvertCheck.cpp
│ ├── LoopConvertCheck.h
│ ├── LoopConvertUtils.cpp
│ ├── LoopConvertUtils.h
│ ├── MakeSharedCheck.cpp
│ ├── MakeSharedCheck.h
│ ├── MakeSmartPtrCheck.cpp
│ ├── MakeSmartPtrCheck.h
│ ├── MakeUniqueCheck.cpp
│ ├── MakeUniqueCheck.h
│ ├── ModernizeTidyModule.cpp
│ ├── PassByValueCheck.cpp
│ ├── PassByValueCheck.h
│ ├── RawStringLiteralCheck.cpp
│ ├── RawStringLiteralCheck.h
│ ├── RedundantVoidArgCheck.cpp
│ ├── RedundantVoidArgCheck.h
│ ├── ReplaceAutoPtrCheck.cpp
│ ├── ReplaceAutoPtrCheck.h
│ ├── ReplaceRandomShuffleCheck.cpp
│ ├── ReplaceRandomShuffleCheck.h
│ ├── ReturnBracedInitListCheck.cpp
│ ├── ReturnBracedInitListCheck.h
│ ├── ShrinkToFitCheck.cpp
│ ├── ShrinkToFitCheck.h
│ ├── UnaryStaticAssertCheck.cpp
│ ├── UnaryStaticAssertCheck.h
│ ├── UseAutoCheck.cpp
│ ├── UseAutoCheck.h
│ ├── UseBoolLiteralsCheck.cpp
│ ├── UseBoolLiteralsCheck.h
│ ├── UseDefaultMemberInitCheck.cpp
│ ├── UseDefaultMemberInitCheck.h
│ ├── UseEmplaceCheck.cpp
│ ├── UseEmplaceCheck.h
│ ├── UseEqualsDefaultCheck.cpp
│ ├── UseEqualsDefaultCheck.h
│ ├── UseEqualsDeleteCheck.cpp
│ ├── UseEqualsDeleteCheck.h
│ ├── UseNodiscardCheck.cpp
│ ├── UseNodiscardCheck.h
│ ├── UseNoexceptCheck.cpp
│ ├── UseNoexceptCheck.h
│ ├── UseNullptrCheck.cpp
│ ├── UseNullptrCheck.h
│ ├── UseOverrideCheck.cpp
│ ├── UseOverrideCheck.h
│ ├── UseTrailingReturnTypeCheck.cpp
│ ├── UseTrailingReturnTypeCheck.h
│ ├── UseTransparentFunctorsCheck.cpp
│ ├── UseTransparentFunctorsCheck.h
│ ├── UseUncaughtExceptionsCheck.cpp
│ ├── UseUncaughtExceptionsCheck.h
│ ├── UseUsingCheck.cpp
│ └── UseUsingCheck.h
├── mpi
│ ├── BufferDerefCheck.cpp
│ ├── BufferDerefCheck.h
│ ├── CMakeLists.txt
│ ├── MPITidyModule.cpp
│ ├── TypeMismatchCheck.cpp
│ └── TypeMismatchCheck.h
├── objc
│ ├── AvoidNSErrorInitCheck.cpp
│ ├── AvoidNSErrorInitCheck.h
│ ├── AvoidSpinlockCheck.cpp
│ ├── AvoidSpinlockCheck.h
│ ├── CMakeLists.txt
│ ├── ForbiddenSubclassingCheck.cpp
│ ├── ForbiddenSubclassingCheck.h
│ ├── ObjCTidyModule.cpp
│ ├── PropertyDeclarationCheck.cpp
│ ├── PropertyDeclarationCheck.h
│ ├── SuperSelfCheck.cpp
│ └── SuperSelfCheck.h
├── openmp
│ ├── CMakeLists.txt
│ ├── ExceptionEscapeCheck.cpp
│ ├── ExceptionEscapeCheck.h
│ ├── OpenMPTidyModule.cpp
│ ├── UseDefaultNoneCheck.cpp
│ └── UseDefaultNoneCheck.h
├── performance
│ ├── CMakeLists.txt
│ ├── FasterStringFindCheck.cpp
│ ├── FasterStringFindCheck.h
│ ├── ForRangeCopyCheck.cpp
│ ├── ForRangeCopyCheck.h
│ ├── ImplicitConversionInLoopCheck.cpp
│ ├── ImplicitConversionInLoopCheck.h
│ ├── InefficientAlgorithmCheck.cpp
│ ├── InefficientAlgorithmCheck.h
│ ├── InefficientStringConcatenationCheck.cpp
│ ├── InefficientStringConcatenationCheck.h
│ ├── InefficientVectorOperationCheck.cpp
│ ├── InefficientVectorOperationCheck.h
│ ├── MoveConstArgCheck.cpp
│ ├── MoveConstArgCheck.h
│ ├── MoveConstructorInitCheck.cpp
│ ├── MoveConstructorInitCheck.h
│ ├── NoexceptMoveConstructorCheck.cpp
│ ├── NoexceptMoveConstructorCheck.h
│ ├── PerformanceTidyModule.cpp
│ ├── TypePromotionInMathFnCheck.cpp
│ ├── TypePromotionInMathFnCheck.h
│ ├── UnnecessaryCopyInitialization.cpp
│ ├── UnnecessaryCopyInitialization.h
│ ├── UnnecessaryValueParamCheck.cpp
│ └── UnnecessaryValueParamCheck.h
├── plugin
│ ├── CMakeLists.txt
│ └── ClangTidyPlugin.cpp
├── portability
│ ├── CMakeLists.txt
│ ├── PortabilityTidyModule.cpp
│ ├── SIMDIntrinsicsCheck.cpp
│ └── SIMDIntrinsicsCheck.h
├── readability
│ ├── AvoidConstParamsInDecls.cpp
│ ├── AvoidConstParamsInDecls.h
│ ├── BracesAroundStatementsCheck.cpp
│ ├── BracesAroundStatementsCheck.h
│ ├── CMakeLists.txt
│ ├── ConstReturnTypeCheck.cpp
│ ├── ConstReturnTypeCheck.h
│ ├── ContainerSizeEmptyCheck.cpp
│ ├── ContainerSizeEmptyCheck.h
│ ├── DeleteNullPointerCheck.cpp
│ ├── DeleteNullPointerCheck.h
│ ├── DeletedDefaultCheck.cpp
│ ├── DeletedDefaultCheck.h
│ ├── ElseAfterReturnCheck.cpp
│ ├── ElseAfterReturnCheck.h
│ ├── FunctionSizeCheck.cpp
│ ├── FunctionSizeCheck.h
│ ├── IdentifierNamingCheck.cpp
│ ├── IdentifierNamingCheck.h
│ ├── ImplicitBoolConversionCheck.cpp
│ ├── ImplicitBoolConversionCheck.h
│ ├── InconsistentDeclarationParameterNameCheck.cpp
│ ├── InconsistentDeclarationParameterNameCheck.h
│ ├── IsolateDeclarationCheck.cpp
│ ├── IsolateDeclarationCheck.h
│ ├── MagicNumbersCheck.cpp
│ ├── MagicNumbersCheck.h
│ ├── MisleadingIndentationCheck.cpp
│ ├── MisleadingIndentationCheck.h
│ ├── MisplacedArrayIndexCheck.cpp
│ ├── MisplacedArrayIndexCheck.h
│ ├── NamedParameterCheck.cpp
│ ├── NamedParameterCheck.h
│ ├── NamespaceCommentCheck.cpp
│ ├── NamespaceCommentCheck.h
│ ├── NonConstParameterCheck.cpp
│ ├── NonConstParameterCheck.h
│ ├── ReadabilityTidyModule.cpp
│ ├── RedundantControlFlowCheck.cpp
│ ├── RedundantControlFlowCheck.h
│ ├── RedundantDeclarationCheck.cpp
│ ├── RedundantDeclarationCheck.h
│ ├── RedundantFunctionPtrDereferenceCheck.cpp
│ ├── RedundantFunctionPtrDereferenceCheck.h
│ ├── RedundantMemberInitCheck.cpp
│ ├── RedundantMemberInitCheck.h
│ ├── RedundantPreprocessorCheck.cpp
│ ├── RedundantPreprocessorCheck.h
│ ├── RedundantSmartptrGetCheck.cpp
│ ├── RedundantSmartptrGetCheck.h
│ ├── RedundantStringCStrCheck.cpp
│ ├── RedundantStringCStrCheck.h
│ ├── RedundantStringInitCheck.cpp
│ ├── RedundantStringInitCheck.h
│ ├── SimplifyBooleanExprCheck.cpp
│ ├── SimplifyBooleanExprCheck.h
│ ├── SimplifySubscriptExprCheck.cpp
│ ├── SimplifySubscriptExprCheck.h
│ ├── StaticAccessedThroughInstanceCheck.cpp
│ ├── StaticAccessedThroughInstanceCheck.h
│ ├── StaticDefinitionInAnonymousNamespaceCheck.cpp
│ ├── StaticDefinitionInAnonymousNamespaceCheck.h
│ ├── StringCompareCheck.cpp
│ ├── StringCompareCheck.h
│ ├── UniqueptrDeleteReleaseCheck.cpp
│ ├── UniqueptrDeleteReleaseCheck.h
│ ├── UppercaseLiteralSuffixCheck.cpp
│ └── UppercaseLiteralSuffixCheck.h
├── rename_check.py
├── tool
│ ├── CMakeLists.txt
│ ├── ClangTidyMain.cpp
│ ├── clang-tidy-diff.py
│ └── run-clang-tidy.py
├── utils
│ ├── ASTUtils.cpp
│ ├── ASTUtils.h
│ ├── CMakeLists.txt
│ ├── DeclRefExprUtils.cpp
│ ├── DeclRefExprUtils.h
│ ├── ExceptionAnalyzer.cpp
│ ├── ExceptionAnalyzer.h
│ ├── ExprSequence.cpp
│ ├── ExprSequence.h
│ ├── FixItHintUtils.cpp
│ ├── FixItHintUtils.h
│ ├── HeaderFileExtensionsUtils.cpp
│ ├── HeaderFileExtensionsUtils.h
│ ├── HeaderGuard.cpp
│ ├── HeaderGuard.h
│ ├── IncludeInserter.cpp
│ ├── IncludeInserter.h
│ ├── IncludeSorter.cpp
│ ├── IncludeSorter.h
│ ├── LexerUtils.cpp
│ ├── LexerUtils.h
│ ├── Matchers.h
│ ├── NamespaceAliaser.cpp
│ ├── NamespaceAliaser.h
│ ├── OptionsUtils.cpp
│ ├── OptionsUtils.h
│ ├── TransformerClangTidyCheck.cpp
│ ├── TransformerClangTidyCheck.h
│ ├── TypeTraits.cpp
│ ├── TypeTraits.h
│ ├── UsingInserter.cpp
│ └── UsingInserter.h
└── zircon
│ ├── CMakeLists.txt
│ ├── TemporaryObjectsCheck.cpp
│ ├── TemporaryObjectsCheck.h
│ └── ZirconTidyModule.cpp
├── clangd
├── AST.cpp
├── AST.h
├── CMakeLists.txt
├── Cancellation.cpp
├── Cancellation.h
├── ClangdLSPServer.cpp
├── ClangdLSPServer.h
├── ClangdServer.cpp
├── ClangdServer.h
├── ClangdUnit.cpp
├── ClangdUnit.h
├── CodeComplete.cpp
├── CodeComplete.h
├── CodeCompletionStrings.cpp
├── CodeCompletionStrings.h
├── Compiler.cpp
├── Compiler.h
├── Context.cpp
├── Context.h
├── Diagnostics.cpp
├── Diagnostics.h
├── DraftStore.cpp
├── DraftStore.h
├── ExpectedTypes.cpp
├── ExpectedTypes.h
├── FS.cpp
├── FS.h
├── FSProvider.cpp
├── FSProvider.h
├── Features.inc.in
├── FileDistance.cpp
├── FileDistance.h
├── FindSymbols.cpp
├── FindSymbols.h
├── Format.cpp
├── Format.h
├── FormattedString.cpp
├── FormattedString.h
├── Function.h
├── FuzzyMatch.cpp
├── FuzzyMatch.h
├── GlobalCompilationDatabase.cpp
├── GlobalCompilationDatabase.h
├── Headers.cpp
├── Headers.h
├── IncludeFixer.cpp
├── IncludeFixer.h
├── JSONTransport.cpp
├── Logger.cpp
├── Logger.h
├── Path.h
├── Protocol.cpp
├── Protocol.h
├── Quality.cpp
├── Quality.h
├── RIFF.cpp
├── RIFF.h
├── Selection.cpp
├── Selection.h
├── SourceCode.cpp
├── SourceCode.h
├── StdSymbolMap.inc
├── TUScheduler.cpp
├── TUScheduler.h
├── Threading.cpp
├── Threading.h
├── Trace.cpp
├── Trace.h
├── Transport.h
├── URI.cpp
├── URI.h
├── XRefs.cpp
├── XRefs.h
├── benchmarks
│ ├── CMakeLists.txt
│ └── IndexBenchmark.cpp
├── clients
│ └── clangd-vscode
│ │ ├── .gitignore
│ │ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ │ ├── .vscodeignore
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── src
│ │ └── extension.ts
│ │ ├── test
│ │ ├── extension.test.ts
│ │ └── index.ts
│ │ ├── tsconfig.json
│ │ └── vsc-extension-quickstart.md
├── fuzzer
│ ├── CMakeLists.txt
│ ├── DummyClangdMain.cpp
│ └── clangd-fuzzer.cpp
├── include-mapping
│ ├── gen_std.py
│ └── test.py
├── index
│ ├── Background.cpp
│ ├── Background.h
│ ├── BackgroundIndexStorage.cpp
│ ├── CanonicalIncludes.cpp
│ ├── CanonicalIncludes.h
│ ├── FileIndex.cpp
│ ├── FileIndex.h
│ ├── Index.cpp
│ ├── Index.h
│ ├── IndexAction.cpp
│ ├── IndexAction.h
│ ├── MemIndex.cpp
│ ├── MemIndex.h
│ ├── Merge.cpp
│ ├── Merge.h
│ ├── Ref.cpp
│ ├── Ref.h
│ ├── Relation.cpp
│ ├── Relation.h
│ ├── Serialization.cpp
│ ├── Serialization.h
│ ├── Symbol.cpp
│ ├── Symbol.h
│ ├── SymbolCollector.cpp
│ ├── SymbolCollector.h
│ ├── SymbolID.cpp
│ ├── SymbolID.h
│ ├── SymbolLocation.cpp
│ ├── SymbolLocation.h
│ ├── SymbolOrigin.cpp
│ ├── SymbolOrigin.h
│ ├── YAMLSerialization.cpp
│ └── dex
│ │ ├── Dex.cpp
│ │ ├── Dex.h
│ │ ├── Iterator.cpp
│ │ ├── Iterator.h
│ │ ├── PostingList.cpp
│ │ ├── PostingList.h
│ │ ├── Token.h
│ │ ├── Trigram.cpp
│ │ ├── Trigram.h
│ │ └── dexp
│ │ ├── CMakeLists.txt
│ │ └── Dexp.cpp
├── indexer
│ ├── CMakeLists.txt
│ └── IndexerMain.cpp
├── refactor
│ ├── Rename.cpp
│ ├── Rename.h
│ ├── Tweak.cpp
│ ├── Tweak.h
│ └── tweaks
│ │ ├── CMakeLists.txt
│ │ ├── DumpAST.cpp
│ │ ├── RawStringLiteral.cpp
│ │ └── SwapIfBranches.cpp
├── test
│ ├── CMakeLists.txt
│ ├── Inputs
│ │ ├── BenchmarkHeader.h
│ │ ├── BenchmarkSource.cpp
│ │ ├── background-index
│ │ │ ├── compile_commands.json
│ │ │ ├── definition.jsonrpc
│ │ │ ├── foo.cpp
│ │ │ └── foo.h
│ │ ├── requests.json
│ │ └── symbols.test.yaml
│ ├── background-index.test
│ ├── compile-commands-path-in-initialize.test
│ ├── completion-auto-trigger.test
│ ├── completion-snippets.test
│ ├── completion.test
│ ├── crash-non-added-files.test
│ ├── delimited-input-comment-at-the-end.test
│ ├── diagnostic-category.test
│ ├── diagnostics-no-tidy.test
│ ├── diagnostics-notes.test
│ ├── diagnostics.test
│ ├── did-change-configuration-params.test
│ ├── execute-command.test
│ ├── exit-with-shutdown.test
│ ├── exit-without-shutdown.test
│ ├── filestatus.test
│ ├── fixits-codeaction.test
│ ├── fixits-command.test
│ ├── fixits-embed-in-diagnostic.test
│ ├── formatting.test
│ ├── hover.test
│ ├── index-tools.test
│ ├── initialize-params-invalid.test
│ ├── initialize-params.test
│ ├── initialize-sequence.test
│ ├── input-mirror.test
│ ├── lit.cfg.py
│ ├── lit.local.cfg
│ ├── lit.site.cfg.py.in
│ ├── protocol.test
│ ├── references.test
│ ├── rename.test
│ ├── signature-help-with-offsets.test
│ ├── signature-help.test
│ ├── spaces-in-delimited-input.test
│ ├── symbol-info.test
│ ├── symbols.test
│ ├── test-uri-posix.test
│ ├── test-uri-windows.test
│ ├── textdocument-didchange-fail.test
│ ├── too_large.test
│ ├── trace.test
│ ├── tweaks-format.test
│ ├── type-hierarchy.test
│ ├── unsupported-method.test
│ ├── utf8.test
│ ├── xpc
│ │ └── initialize.test
│ └── xrefs.test
├── tool
│ ├── CMakeLists.txt
│ └── ClangdMain.cpp
├── unittests
│ ├── Annotations.cpp
│ ├── Annotations.h
│ ├── BackgroundIndexTests.cpp
│ ├── CMakeLists.txt
│ ├── CancellationTests.cpp
│ ├── CanonicalIncludesTests.cpp
│ ├── ClangdTests.cpp
│ ├── ClangdUnitTests.cpp
│ ├── CodeCompleteTests.cpp
│ ├── CodeCompletionStringsTests.cpp
│ ├── ContextTests.cpp
│ ├── DexTests.cpp
│ ├── DiagnosticsTests.cpp
│ ├── DraftStoreTests.cpp
│ ├── ExpectedTypeTest.cpp
│ ├── FSTests.cpp
│ ├── FileDistanceTests.cpp
│ ├── FileIndexTests.cpp
│ ├── FindSymbolsTests.cpp
│ ├── FormatTests.cpp
│ ├── FormattedStringTests.cpp
│ ├── FunctionTests.cpp
│ ├── FuzzyMatchTests.cpp
│ ├── GlobalCompilationDatabaseTests.cpp
│ ├── HeadersTests.cpp
│ ├── IndexActionTests.cpp
│ ├── IndexTests.cpp
│ ├── JSONTransportTests.cpp
│ ├── Matchers.h
│ ├── PrintASTTests.cpp
│ ├── QualityTests.cpp
│ ├── RIFFTests.cpp
│ ├── RenameTests.cpp
│ ├── SelectionTests.cpp
│ ├── SerializationTests.cpp
│ ├── SourceCodeTests.cpp
│ ├── SymbolCollectorTests.cpp
│ ├── SymbolInfoTests.cpp
│ ├── SyncAPI.cpp
│ ├── SyncAPI.h
│ ├── TUSchedulerTests.cpp
│ ├── TestFS.cpp
│ ├── TestFS.h
│ ├── TestIndex.cpp
│ ├── TestIndex.h
│ ├── TestScheme.h
│ ├── TestTU.cpp
│ ├── TestTU.h
│ ├── ThreadingTests.cpp
│ ├── TraceTests.cpp
│ ├── TweakTests.cpp
│ ├── TypeHierarchyTests.cpp
│ ├── URITests.cpp
│ ├── XRefsTests.cpp
│ ├── lit.cfg.py
│ ├── lit.site.cfg.py.in
│ └── xpc
│ │ ├── CMakeLists.txt
│ │ └── ConversionTests.cpp
└── xpc
│ ├── CMakeLists.txt
│ ├── Conversion.cpp
│ ├── Conversion.h
│ ├── README.txt
│ ├── XPCTransport.cpp
│ ├── cmake
│ ├── Info.plist.in
│ ├── XPCServiceInfo.plist.in
│ └── modules
│ │ └── CreateClangdXPCFramework.cmake
│ ├── framework
│ ├── CMakeLists.txt
│ └── ClangdXPC.cpp
│ └── test-client
│ ├── CMakeLists.txt
│ └── ClangdXPCTestClient.cpp
├── docs
├── CMakeLists.txt
├── ModularizeUsage.rst
├── README.txt
├── ReleaseNotes.rst
├── _static
│ └── clang-tools-extra-styles.css
├── _templates
│ └── layout.html
├── clang-doc.rst
├── clang-include-fixer.rst
├── clang-modernize.rst
├── clang-rename.rst
├── clang-tidy.rst
├── clang-tidy
│ ├── Contributing.rst
│ ├── Integrations.rst
│ ├── checks
│ │ ├── abseil-duration-addition.rst
│ │ ├── abseil-duration-comparison.rst
│ │ ├── abseil-duration-conversion-cast.rst
│ │ ├── abseil-duration-division.rst
│ │ ├── abseil-duration-factory-float.rst
│ │ ├── abseil-duration-factory-scale.rst
│ │ ├── abseil-duration-subtraction.rst
│ │ ├── abseil-duration-unnecessary-conversion.rst
│ │ ├── abseil-faster-strsplit-delimiter.rst
│ │ ├── abseil-no-internal-dependencies.rst
│ │ ├── abseil-no-namespace.rst
│ │ ├── abseil-redundant-strcat-calls.rst
│ │ ├── abseil-str-cat-append.rst
│ │ ├── abseil-string-find-startswith.rst
│ │ ├── abseil-time-comparison.rst
│ │ ├── abseil-time-subtraction.rst
│ │ ├── abseil-upgrade-duration-conversions.rst
│ │ ├── android-cloexec-accept.rst
│ │ ├── android-cloexec-accept4.rst
│ │ ├── android-cloexec-creat.rst
│ │ ├── android-cloexec-dup.rst
│ │ ├── android-cloexec-epoll-create.rst
│ │ ├── android-cloexec-epoll-create1.rst
│ │ ├── android-cloexec-fopen.rst
│ │ ├── android-cloexec-inotify-init.rst
│ │ ├── android-cloexec-inotify-init1.rst
│ │ ├── android-cloexec-memfd-create.rst
│ │ ├── android-cloexec-open.rst
│ │ ├── android-cloexec-pipe.rst
│ │ ├── android-cloexec-pipe2.rst
│ │ ├── android-cloexec-socket.rst
│ │ ├── android-comparison-in-temp-failure-retry.rst
│ │ ├── boost-use-to-string.rst
│ │ ├── bugprone-argument-comment.rst
│ │ ├── bugprone-assert-side-effect.rst
│ │ ├── bugprone-bool-pointer-implicit-conversion.rst
│ │ ├── bugprone-branch-clone.rst
│ │ ├── bugprone-copy-constructor-init.rst
│ │ ├── bugprone-dangling-handle.rst
│ │ ├── bugprone-exception-escape.rst
│ │ ├── bugprone-fold-init-type.rst
│ │ ├── bugprone-forward-declaration-namespace.rst
│ │ ├── bugprone-forwarding-reference-overload.rst
│ │ ├── bugprone-inaccurate-erase.rst
│ │ ├── bugprone-incorrect-roundings.rst
│ │ ├── bugprone-integer-division.rst
│ │ ├── bugprone-lambda-function-name.rst
│ │ ├── bugprone-macro-parentheses.rst
│ │ ├── bugprone-macro-repeated-side-effects.rst
│ │ ├── bugprone-misplaced-operator-in-strlen-in-alloc.rst
│ │ ├── bugprone-misplaced-widening-cast.rst
│ │ ├── bugprone-move-forwarding-reference.rst
│ │ ├── bugprone-multiple-statement-macro.rst
│ │ ├── bugprone-parent-virtual-call.rst
│ │ ├── bugprone-sizeof-container.rst
│ │ ├── bugprone-sizeof-expression.rst
│ │ ├── bugprone-string-constructor.rst
│ │ ├── bugprone-string-integer-assignment.rst
│ │ ├── bugprone-string-literal-with-embedded-nul.rst
│ │ ├── bugprone-suspicious-enum-usage.rst
│ │ ├── bugprone-suspicious-memset-usage.rst
│ │ ├── bugprone-suspicious-missing-comma.rst
│ │ ├── bugprone-suspicious-semicolon.rst
│ │ ├── bugprone-suspicious-string-compare.rst
│ │ ├── bugprone-swapped-arguments.rst
│ │ ├── bugprone-terminating-continue.rst
│ │ ├── bugprone-throw-keyword-missing.rst
│ │ ├── bugprone-too-small-loop-variable.rst
│ │ ├── bugprone-undefined-memory-manipulation.rst
│ │ ├── bugprone-undelegated-constructor.rst
│ │ ├── bugprone-unhandled-self-assignment.rst
│ │ ├── bugprone-unused-raii.rst
│ │ ├── bugprone-unused-return-value.rst
│ │ ├── bugprone-use-after-move.rst
│ │ ├── bugprone-virtual-near-miss.rst
│ │ ├── cert-dcl03-c.rst
│ │ ├── cert-dcl16-c.rst
│ │ ├── cert-dcl21-cpp.rst
│ │ ├── cert-dcl50-cpp.rst
│ │ ├── cert-dcl54-cpp.rst
│ │ ├── cert-dcl58-cpp.rst
│ │ ├── cert-dcl59-cpp.rst
│ │ ├── cert-env33-c.rst
│ │ ├── cert-err09-cpp.rst
│ │ ├── cert-err34-c.rst
│ │ ├── cert-err52-cpp.rst
│ │ ├── cert-err58-cpp.rst
│ │ ├── cert-err60-cpp.rst
│ │ ├── cert-err61-cpp.rst
│ │ ├── cert-fio38-c.rst
│ │ ├── cert-flp30-c.rst
│ │ ├── cert-msc30-c.rst
│ │ ├── cert-msc32-c.rst
│ │ ├── cert-msc50-cpp.rst
│ │ ├── cert-msc51-cpp.rst
│ │ ├── cert-oop11-cpp.rst
│ │ ├── cert-oop54-cpp.rst
│ │ ├── cppcoreguidelines-avoid-c-arrays.rst
│ │ ├── cppcoreguidelines-avoid-goto.rst
│ │ ├── cppcoreguidelines-avoid-magic-numbers.rst
│ │ ├── cppcoreguidelines-c-copy-assignment-signature.rst
│ │ ├── cppcoreguidelines-explicit-virtual-functions.rst
│ │ ├── cppcoreguidelines-interfaces-global-init.rst
│ │ ├── cppcoreguidelines-macro-usage.rst
│ │ ├── cppcoreguidelines-narrowing-conversions.rst
│ │ ├── cppcoreguidelines-no-malloc.rst
│ │ ├── cppcoreguidelines-non-private-member-variables-in-classes.rst
│ │ ├── cppcoreguidelines-owning-memory.rst
│ │ ├── cppcoreguidelines-pro-bounds-array-to-pointer-decay.rst
│ │ ├── cppcoreguidelines-pro-bounds-constant-array-index.rst
│ │ ├── cppcoreguidelines-pro-bounds-pointer-arithmetic.rst
│ │ ├── cppcoreguidelines-pro-type-const-cast.rst
│ │ ├── cppcoreguidelines-pro-type-cstyle-cast.rst
│ │ ├── cppcoreguidelines-pro-type-member-init.rst
│ │ ├── cppcoreguidelines-pro-type-reinterpret-cast.rst
│ │ ├── cppcoreguidelines-pro-type-static-cast-downcast.rst
│ │ ├── cppcoreguidelines-pro-type-union-access.rst
│ │ ├── cppcoreguidelines-pro-type-vararg.rst
│ │ ├── cppcoreguidelines-slicing.rst
│ │ ├── cppcoreguidelines-special-member-functions.rst
│ │ ├── fuchsia-default-arguments-calls.rst
│ │ ├── fuchsia-default-arguments-declarations.rst
│ │ ├── fuchsia-header-anon-namespaces.rst
│ │ ├── fuchsia-multiple-inheritance.rst
│ │ ├── fuchsia-overloaded-operator.rst
│ │ ├── fuchsia-restrict-system-includes.rst
│ │ ├── fuchsia-statically-constructed-objects.rst
│ │ ├── fuchsia-trailing-return.rst
│ │ ├── fuchsia-virtual-inheritance.rst
│ │ ├── google-build-explicit-make-pair.rst
│ │ ├── google-build-namespaces.rst
│ │ ├── google-build-using-namespace.rst
│ │ ├── google-default-arguments.rst
│ │ ├── google-explicit-constructor.rst
│ │ ├── google-global-names-in-headers.rst
│ │ ├── google-objc-avoid-nsobject-new.rst
│ │ ├── google-objc-avoid-throwing-exception.rst
│ │ ├── google-objc-function-naming.rst
│ │ ├── google-objc-global-variable-declaration.rst
│ │ ├── google-readability-avoid-underscore-in-googletest-name.rst
│ │ ├── google-readability-braces-around-statements.rst
│ │ ├── google-readability-casting.rst
│ │ ├── google-readability-function-size.rst
│ │ ├── google-readability-namespace-comments.rst
│ │ ├── google-readability-todo.rst
│ │ ├── google-runtime-int.rst
│ │ ├── google-runtime-operator.rst
│ │ ├── google-runtime-references.rst
│ │ ├── hicpp-avoid-c-arrays.rst
│ │ ├── hicpp-avoid-goto.rst
│ │ ├── hicpp-braces-around-statements.rst
│ │ ├── hicpp-deprecated-headers.rst
│ │ ├── hicpp-exception-baseclass.rst
│ │ ├── hicpp-explicit-conversions.rst
│ │ ├── hicpp-function-size.rst
│ │ ├── hicpp-invalid-access-moved.rst
│ │ ├── hicpp-member-init.rst
│ │ ├── hicpp-move-const-arg.rst
│ │ ├── hicpp-multiway-paths-covered.rst
│ │ ├── hicpp-named-parameter.rst
│ │ ├── hicpp-new-delete-operators.rst
│ │ ├── hicpp-no-array-decay.rst
│ │ ├── hicpp-no-assembler.rst
│ │ ├── hicpp-no-malloc.rst
│ │ ├── hicpp-noexcept-move.rst
│ │ ├── hicpp-signed-bitwise.rst
│ │ ├── hicpp-special-member-functions.rst
│ │ ├── hicpp-static-assert.rst
│ │ ├── hicpp-undelegated-constructor.rst
│ │ ├── hicpp-uppercase-literal-suffix.rst
│ │ ├── hicpp-use-auto.rst
│ │ ├── hicpp-use-emplace.rst
│ │ ├── hicpp-use-equals-default.rst
│ │ ├── hicpp-use-equals-delete.rst
│ │ ├── hicpp-use-noexcept.rst
│ │ ├── hicpp-use-nullptr.rst
│ │ ├── hicpp-use-override.rst
│ │ ├── hicpp-vararg.rst
│ │ ├── list.rst
│ │ ├── llvm-header-guard.rst
│ │ ├── llvm-include-order.rst
│ │ ├── llvm-namespace-comment.rst
│ │ ├── llvm-prefer-isa-or-dyn-cast-in-conditionals.rst
│ │ ├── llvm-twine-local.rst
│ │ ├── misc-definitions-in-headers.rst
│ │ ├── misc-misplaced-const.rst
│ │ ├── misc-new-delete-overloads.rst
│ │ ├── misc-non-copyable-objects.rst
│ │ ├── misc-non-private-member-variables-in-classes.rst
│ │ ├── misc-redundant-expression.rst
│ │ ├── misc-static-assert.rst
│ │ ├── misc-throw-by-value-catch-by-reference.rst
│ │ ├── misc-unconventional-assign-operator.rst
│ │ ├── misc-uniqueptr-reset-release.rst
│ │ ├── misc-unused-alias-decls.rst
│ │ ├── misc-unused-parameters.rst
│ │ ├── misc-unused-using-decls.rst
│ │ ├── modernize-avoid-bind.rst
│ │ ├── modernize-avoid-c-arrays.rst
│ │ ├── modernize-concat-nested-namespaces.rst
│ │ ├── modernize-deprecated-headers.rst
│ │ ├── modernize-deprecated-ios-base-aliases.rst
│ │ ├── modernize-loop-convert.rst
│ │ ├── modernize-make-shared.rst
│ │ ├── modernize-make-unique.rst
│ │ ├── modernize-pass-by-value.rst
│ │ ├── modernize-raw-string-literal.rst
│ │ ├── modernize-redundant-void-arg.rst
│ │ ├── modernize-replace-auto-ptr.rst
│ │ ├── modernize-replace-random-shuffle.rst
│ │ ├── modernize-return-braced-init-list.rst
│ │ ├── modernize-shrink-to-fit.rst
│ │ ├── modernize-unary-static-assert.rst
│ │ ├── modernize-use-auto.rst
│ │ ├── modernize-use-bool-literals.rst
│ │ ├── modernize-use-default-member-init.rst
│ │ ├── modernize-use-default.rst
│ │ ├── modernize-use-emplace.rst
│ │ ├── modernize-use-equals-default.rst
│ │ ├── modernize-use-equals-delete.rst
│ │ ├── modernize-use-nodiscard.rst
│ │ ├── modernize-use-noexcept.rst
│ │ ├── modernize-use-nullptr.rst
│ │ ├── modernize-use-override.rst
│ │ ├── modernize-use-trailing-return-type.rst
│ │ ├── modernize-use-transparent-functors.rst
│ │ ├── modernize-use-uncaught-exceptions.rst
│ │ ├── modernize-use-using.rst
│ │ ├── mpi-buffer-deref.rst
│ │ ├── mpi-type-mismatch.rst
│ │ ├── objc-avoid-nserror-init.rst
│ │ ├── objc-avoid-spinlock.rst
│ │ ├── objc-forbidden-subclassing.rst
│ │ ├── objc-property-declaration.rst
│ │ ├── objc-super-self.rst
│ │ ├── openmp-exception-escape.rst
│ │ ├── openmp-use-default-none.rst
│ │ ├── performance-faster-string-find.rst
│ │ ├── performance-for-range-copy.rst
│ │ ├── performance-implicit-cast-in-loop.rst
│ │ ├── performance-implicit-conversion-in-loop.rst
│ │ ├── performance-inefficient-algorithm.rst
│ │ ├── performance-inefficient-string-concatenation.rst
│ │ ├── performance-inefficient-vector-operation.rst
│ │ ├── performance-move-const-arg.rst
│ │ ├── performance-move-constructor-init.rst
│ │ ├── performance-noexcept-move-constructor.rst
│ │ ├── performance-type-promotion-in-math-fn.rst
│ │ ├── performance-unnecessary-copy-initialization.rst
│ │ ├── performance-unnecessary-value-param.rst
│ │ ├── portability-simd-intrinsics.rst
│ │ ├── readability-avoid-const-params-in-decls.rst
│ │ ├── readability-braces-around-statements.rst
│ │ ├── readability-const-return-type.rst
│ │ ├── readability-container-size-empty.rst
│ │ ├── readability-delete-null-pointer.rst
│ │ ├── readability-deleted-default.rst
│ │ ├── readability-else-after-return.rst
│ │ ├── readability-function-size.rst
│ │ ├── readability-identifier-naming.rst
│ │ ├── readability-implicit-bool-cast.rst
│ │ ├── readability-implicit-bool-conversion.rst
│ │ ├── readability-inconsistent-declaration-parameter-name.rst
│ │ ├── readability-isolate-declaration.rst
│ │ ├── readability-magic-numbers.rst
│ │ ├── readability-misleading-indentation.rst
│ │ ├── readability-misplaced-array-index.rst
│ │ ├── readability-named-parameter.rst
│ │ ├── readability-non-const-parameter.rst
│ │ ├── readability-redundant-control-flow.rst
│ │ ├── readability-redundant-declaration.rst
│ │ ├── readability-redundant-function-ptr-dereference.rst
│ │ ├── readability-redundant-member-init.rst
│ │ ├── readability-redundant-preprocessor.rst
│ │ ├── readability-redundant-smartptr-get.rst
│ │ ├── readability-redundant-string-cstr.rst
│ │ ├── readability-redundant-string-init.rst
│ │ ├── readability-simplify-boolean-expr.rst
│ │ ├── readability-simplify-subscript-expr.rst
│ │ ├── readability-static-accessed-through-instance.rst
│ │ ├── readability-static-definition-in-anonymous-namespace.rst
│ │ ├── readability-string-compare.rst
│ │ ├── readability-uniqueptr-delete-release.rst
│ │ ├── readability-uppercase-literal-suffix.rst
│ │ └── zircon-temporary-objects.rst
│ └── index.rst
├── clangd.rst
├── clangd
│ ├── ApplyClangTidyFixInVSCode.gif
│ ├── ApplyFixInVSCode.gif
│ ├── CodeCompletionInEmacsCompanyMode.png
│ ├── CodeCompletionInSublimeText.png
│ ├── CodeCompletionInVSCode.png
│ ├── CodeCompletionInYCM.png
│ ├── CodeCompletionInsertsNamespaceQualifiersInVSCode.gif
│ ├── DeveloperDocumentation.rst
│ ├── DiagnosticsInEmacsEglot.png
│ ├── ErrorsInVSCode.png
│ ├── Extensions.rst
│ ├── Features.rst
│ ├── FindAllReferencesInVSCode.gif
│ ├── FormatSelectionInVSCode.gif
│ ├── GoToDefinitionInVSCode.gif
│ ├── Installation.rst
│ ├── NavigationWithBreadcrumbsInVSCode.gif
│ ├── OutlineInVSCode.png
│ ├── SignatureHelpInVSCode.gif
│ └── index.rst
├── conf.py
├── cpp11-migrate.rst
├── doxygen-mainpage.dox
├── doxygen.cfg.in
├── index.rst
├── make.bat
├── modularize.rst
└── pp-trace.rst
├── modularize
├── CMakeLists.txt
├── CoverageChecker.cpp
├── CoverageChecker.h
├── Modularize.cpp
├── Modularize.h
├── ModularizeUtilities.cpp
├── ModularizeUtilities.h
├── ModuleAssistant.cpp
├── PreprocessorTracker.cpp
└── PreprocessorTracker.h
├── pp-trace
├── CMakeLists.txt
├── PPCallbacksTracker.cpp
├── PPCallbacksTracker.h
└── PPTrace.cpp
├── test
├── .clang-format
├── CMakeLists.txt
├── Unit
│ ├── lit.cfg.py
│ └── lit.site.cfg.py.in
├── clang-apply-replacements
│ ├── ClangRenameClassReplacements.cpp
│ ├── Inputs
│ │ ├── basic
│ │ │ ├── basic.h
│ │ │ ├── file1.yaml
│ │ │ └── file2.yaml
│ │ ├── conflict
│ │ │ ├── common.h
│ │ │ ├── expected.txt
│ │ │ ├── file1.yaml
│ │ │ ├── file2.yaml
│ │ │ └── file3.yaml
│ │ ├── crlf
│ │ │ ├── crlf.cpp
│ │ │ ├── crlf.cpp.expected
│ │ │ └── file1.yaml
│ │ ├── format
│ │ │ ├── no.cpp
│ │ │ ├── no.yaml
│ │ │ ├── yes.cpp
│ │ │ └── yes.yaml
│ │ ├── identical
│ │ │ ├── file1.yaml
│ │ │ ├── file2.yaml
│ │ │ └── identical.cpp
│ │ ├── invalid-files
│ │ │ └── invalid-files.yaml
│ │ └── order-dependent
│ │ │ ├── expected.txt
│ │ │ ├── file1.yaml
│ │ │ ├── file2.yaml
│ │ │ └── order-dependent.cpp
│ ├── basic.cpp
│ ├── conflict.cpp
│ ├── crlf.cpp
│ ├── format.cpp
│ ├── identical.cpp
│ ├── invalid-files.cpp
│ └── order-dependent.cpp
├── clang-change-namespace
│ ├── Inputs
│ │ └── fake-std.h
│ ├── lambda-function.cpp
│ ├── macro.cpp
│ ├── simple-move.cpp
│ └── white-list.cpp
├── clang-doc
│ ├── single-file-public.cpp
│ └── single-file.cpp
├── clang-include-fixer
│ ├── Inputs
│ │ ├── database_template.json
│ │ ├── fake_yaml_db.yaml
│ │ └── merge
│ │ │ ├── a.yaml
│ │ │ └── b.yaml
│ ├── commandline_options.cpp
│ ├── exit_on_fatal.cpp
│ ├── fixeddb.cpp
│ ├── include_path.cpp
│ ├── merge.test
│ ├── multiple_fixes.cpp
│ ├── prefix_variable.cpp
│ ├── query_symbol.cpp
│ ├── ranking.cpp
│ ├── yaml_fuzzy.cpp
│ ├── yamldb.cpp
│ └── yamldb_autodetect.cpp
├── clang-move
│ ├── Inputs
│ │ ├── database_template.json
│ │ ├── enum.h
│ │ ├── function_test.cpp
│ │ ├── function_test.h
│ │ ├── helper_decls_test.cpp
│ │ ├── helper_decls_test.h
│ │ ├── macro_helper_test.cpp
│ │ ├── macro_helper_test.h
│ │ ├── multiple_class_test.cpp
│ │ ├── multiple_class_test.h
│ │ ├── template_class_test.cpp
│ │ ├── template_class_test.h
│ │ ├── test.cpp
│ │ ├── test.h
│ │ ├── type_alias.h
│ │ ├── var_test.cpp
│ │ └── var_test.h
│ ├── move-class.cpp
│ ├── move-enum-decl.cpp
│ ├── move-function.cpp
│ ├── move-multiple-classes.cpp
│ ├── move-template-class.cpp
│ ├── move-type-alias.cpp
│ ├── move-used-helper-decls.cpp
│ ├── move-var.cpp
│ └── no-move-macro-helpers.cpp
├── clang-query
│ ├── Inputs
│ │ └── foo.script
│ ├── errors.c
│ └── function-decl.c
├── clang-reorder-fields
│ ├── AggregatePartialInitialization.cpp
│ ├── CStructAmbiguousName.cpp
│ ├── CStructFieldsOrder.cpp
│ ├── ClassDerived.cpp
│ ├── ClassDifferentFieldsAccesses.cpp
│ ├── ClassMixedInitialization.cpp
│ ├── ClassSimpleCtor.cpp
│ ├── FieldDependencyWarning.cpp
│ ├── FieldDependencyWarningDerived.cpp
│ └── PlainCStructFieldsOrder.c
├── clang-tidy
│ ├── Inputs
│ │ ├── Headers
│ │ │ ├── a.h
│ │ │ ├── b.h
│ │ │ ├── clang-c
│ │ │ │ └── c.h
│ │ │ ├── clang
│ │ │ │ └── b.h
│ │ │ ├── cross-file-a.h
│ │ │ ├── cross-file-b.h
│ │ │ ├── cross-file-c.h
│ │ │ ├── gtest
│ │ │ │ └── foo.h
│ │ │ ├── i.h
│ │ │ ├── j.h
│ │ │ ├── llvm-c
│ │ │ │ └── d.h
│ │ │ ├── llvm
│ │ │ │ └── a.h
│ │ │ ├── s.h
│ │ │ ├── stdio.h
│ │ │ └── system-header-simulation.h
│ │ ├── absl
│ │ │ ├── external-file.h
│ │ │ ├── flags
│ │ │ │ └── internal-file.h
│ │ │ ├── strings
│ │ │ │ └── internal-file.h
│ │ │ └── time
│ │ │ │ └── time.h
│ │ ├── compilation-database
│ │ │ └── template.json
│ │ ├── config-files
│ │ │ ├── 1
│ │ │ │ └── .clang-tidy
│ │ │ └── .clang-tidy
│ │ ├── expand-modular-headers-ppcallbacks
│ │ │ ├── a.h
│ │ │ ├── b.h
│ │ │ ├── c.h
│ │ │ └── module.modulemap
│ │ ├── explain-config
│ │ │ └── .clang-tidy
│ │ ├── file-filter
│ │ │ ├── header1.h
│ │ │ ├── header2.h
│ │ │ └── system
│ │ │ │ └── system-header.h
│ │ ├── fuchsia-restrict-system-includes
│ │ │ ├── a.h
│ │ │ ├── system
│ │ │ │ ├── cstdarg.h
│ │ │ │ ├── cstdlib.h
│ │ │ │ ├── j.h
│ │ │ │ ├── r.h
│ │ │ │ ├── s.h
│ │ │ │ ├── t.h
│ │ │ │ └── transitive.h
│ │ │ └── transitive2.h
│ │ ├── google-namespaces.h
│ │ ├── line-filter
│ │ │ ├── header1.h
│ │ │ ├── header2.h
│ │ │ └── header3.h
│ │ ├── mock-libcxx
│ │ │ ├── bin
│ │ │ │ └── clang
│ │ │ └── include
│ │ │ │ └── c++
│ │ │ │ └── v1
│ │ │ │ └── mock_vector
│ │ ├── modernize-deprecated-headers
│ │ │ ├── assert.h
│ │ │ ├── complex.h
│ │ │ ├── ctype.h
│ │ │ ├── errno.h
│ │ │ ├── fenv.h
│ │ │ ├── float.h
│ │ │ ├── inttypes.h
│ │ │ ├── iso646.h
│ │ │ ├── limits.h
│ │ │ ├── locale.h
│ │ │ ├── math.h
│ │ │ ├── setjmp.h
│ │ │ ├── signal.h
│ │ │ ├── stdalign.h
│ │ │ ├── stdarg.h
│ │ │ ├── stdbool.h
│ │ │ ├── stddef.h
│ │ │ ├── stdint.h
│ │ │ ├── stdio.h
│ │ │ ├── stdlib.h
│ │ │ ├── string.h
│ │ │ ├── tgmath.h
│ │ │ ├── time.h
│ │ │ ├── uchar.h
│ │ │ ├── wchar.h
│ │ │ └── wctype.h
│ │ ├── modernize-loop-convert
│ │ │ └── structures.h
│ │ ├── modernize-pass-by-value
│ │ │ ├── header-with-fix.h
│ │ │ └── header.h
│ │ ├── modernize-replace-auto-ptr
│ │ │ └── memory.h
│ │ ├── modernize-smart-ptr
│ │ │ ├── initializer_list.h
│ │ │ ├── shared_ptr.h
│ │ │ └── unique_ptr.h
│ │ ├── modernize-use-auto
│ │ │ └── containers.h
│ │ ├── mpi-type-mismatch
│ │ │ └── mpimock.h
│ │ ├── nolint
│ │ │ └── trigger_warning.h
│ │ ├── overlapping
│ │ │ └── o.h
│ │ ├── performance-unnecessary-value-param
│ │ │ ├── header-fixed.h
│ │ │ └── header.h
│ │ ├── readability-identifier-naming
│ │ │ ├── system
│ │ │ │ └── system-header.h
│ │ │ └── user-header.h
│ │ ├── unused-using-decls.h
│ │ └── vfsoverlay
│ │ │ ├── actual_header.h
│ │ │ └── vfsoverlay.yaml
│ ├── abseil-duration-addition.cpp
│ ├── abseil-duration-comparison.cpp
│ ├── abseil-duration-conversion-cast.cpp
│ ├── abseil-duration-division.cpp
│ ├── abseil-duration-factory-float.cpp
│ ├── abseil-duration-factory-scale.cpp
│ ├── abseil-duration-subtraction.cpp
│ ├── abseil-duration-unnecessary-conversion.cpp
│ ├── abseil-faster-strsplit-delimiter.cpp
│ ├── abseil-no-internal-dependencies.cpp
│ ├── abseil-no-namespace.cpp
│ ├── abseil-redundant-strcat-calls.cpp
│ ├── abseil-str-cat-append.cpp
│ ├── abseil-string-find-startswith.cpp
│ ├── abseil-time-comparison.cpp
│ ├── abseil-time-subtraction.cpp
│ ├── abseil-upgrade-duration-conversions.cpp
│ ├── alternative-fixes.cpp
│ ├── android-cloexec-accept.cpp
│ ├── android-cloexec-accept4.cpp
│ ├── android-cloexec-creat.cpp
│ ├── android-cloexec-dup.cpp
│ ├── android-cloexec-epoll-create.cpp
│ ├── android-cloexec-epoll-create1.cpp
│ ├── android-cloexec-fopen.cpp
│ ├── android-cloexec-inotify-init.cpp
│ ├── android-cloexec-inotify-init1.cpp
│ ├── android-cloexec-memfd-create.cpp
│ ├── android-cloexec-open.cpp
│ ├── android-cloexec-pipe.cpp
│ ├── android-cloexec-pipe2.cpp
│ ├── android-cloexec-socket.cpp
│ ├── android-comparison-in-temp-failure-retry.c
│ ├── basic.cpp
│ ├── boost-use-to-string.cpp
│ ├── bugprone-argument-comment-gmock.cpp
│ ├── bugprone-argument-comment-literals.cpp
│ ├── bugprone-argument-comment-strict.cpp
│ ├── bugprone-argument-comment.cpp
│ ├── bugprone-assert-side-effect.cpp
│ ├── bugprone-bool-pointer-implicit-conversion.cpp
│ ├── bugprone-branch-clone.cpp
│ ├── bugprone-copy-constructor-init.cpp
│ ├── bugprone-dangling-handle.cpp
│ ├── bugprone-exception-escape-openmp.cpp
│ ├── bugprone-exception-escape.cpp
│ ├── bugprone-fold-init-type.cpp
│ ├── bugprone-forward-declaration-namespace.cpp
│ ├── bugprone-forwarding-reference-overload.cpp
│ ├── bugprone-inaccurate-erase.cpp
│ ├── bugprone-incorrect-roundings.cpp
│ ├── bugprone-integer-division.cpp
│ ├── bugprone-lambda-function-name.cpp
│ ├── bugprone-macro-parentheses-cmdline.cpp
│ ├── bugprone-macro-parentheses.cpp
│ ├── bugprone-macro-repeated-side-effects.c
│ ├── bugprone-misplaced-operator-in-strlen-in-alloc.c
│ ├── bugprone-misplaced-operator-in-strlen-in-alloc.cpp
│ ├── bugprone-misplaced-widening-cast-explicit-only.cpp
│ ├── bugprone-misplaced-widening-cast-implicit-enabled.cpp
│ ├── bugprone-move-forwarding-reference.cpp
│ ├── bugprone-multiple-statement-macro.cpp
│ ├── bugprone-parent-virtual-call.cpp
│ ├── bugprone-sizeof-container.cpp
│ ├── bugprone-sizeof-expression.cpp
│ ├── bugprone-string-constructor.cpp
│ ├── bugprone-string-integer-assignment.cpp
│ ├── bugprone-string-literal-with-embedded-nul.cpp
│ ├── bugprone-suspicious-enum-usage-strict.cpp
│ ├── bugprone-suspicious-enum-usage.cpp
│ ├── bugprone-suspicious-memset-usage.cpp
│ ├── bugprone-suspicious-missing-comma.cpp
│ ├── bugprone-suspicious-semicolon-fail.cpp
│ ├── bugprone-suspicious-semicolon.cpp
│ ├── bugprone-suspicious-string-compare.c
│ ├── bugprone-suspicious-string-compare.cpp
│ ├── bugprone-swapped-arguments.cpp
│ ├── bugprone-terminating-continue.cpp
│ ├── bugprone-throw-keyword-missing.cpp
│ ├── bugprone-too-small-loop-variable-magniute-bits-upper-limit.cpp
│ ├── bugprone-too-small-loop-variable.cpp
│ ├── bugprone-undefined-memory-manipulation.cpp
│ ├── bugprone-undelegated-constructor-cxx98.cpp
│ ├── bugprone-undelegated-constructor.cpp
│ ├── bugprone-unhandled-self-assignment-warn-only-if-this-has-suspicious-field.cpp
│ ├── bugprone-unhandled-self-assignment.cpp
│ ├── bugprone-unused-raii.cpp
│ ├── bugprone-unused-return-value-custom.cpp
│ ├── bugprone-unused-return-value.cpp
│ ├── bugprone-use-after-move.cpp
│ ├── bugprone-virtual-near-miss.cpp
│ ├── cert-dcl21-cpp.cpp
│ ├── cert-dcl58-cpp.cpp
│ ├── cert-env33-c.c
│ ├── cert-err34-c.c
│ ├── cert-err34-c.cpp
│ ├── cert-flp30-c.c
│ ├── cert-limited-randomness.c
│ ├── cert-limited-randomness.cpp
│ ├── cert-msc32-c.c
│ ├── cert-msc51-cpp.cpp
│ ├── cert-oop11-cpp.cpp
│ ├── cert-oop54-cpp.cpp
│ ├── cert-setlongjmp.cpp
│ ├── cert-static-object-exception.cpp
│ ├── cert-throw-exception-type.cpp
│ ├── cert-uppercase-literal-suffix-integer.cpp
│ ├── cert-variadic-function-def.cpp
│ ├── check_clang_tidy.cpp
│ ├── check_clang_tidy.py
│ ├── clang-tidy-__clang_analyzer__macro.cpp
│ ├── clang-tidy-diff.cpp
│ ├── clang-tidy-enable-check-profile-one-tu.cpp
│ ├── clang-tidy-enable-check-profile-two-tu.cpp
│ ├── clang-tidy-mac-libcxx.cpp
│ ├── clang-tidy-run-with-database.cpp
│ ├── clang-tidy-store-check-profile-one-tu.cpp
│ ├── clean-up-code.cpp
│ ├── config-files.cpp
│ ├── cppcoreguidelines-avoid-goto.cpp
│ ├── cppcoreguidelines-interfaces-global-init.cpp
│ ├── cppcoreguidelines-macro-usage-caps-only.cpp
│ ├── cppcoreguidelines-macro-usage-command-line-macros.cpp
│ ├── cppcoreguidelines-macro-usage-custom.cpp
│ ├── cppcoreguidelines-macro-usage.cpp
│ ├── cppcoreguidelines-narrowing-conversions-long-is-32bits.cpp
│ ├── cppcoreguidelines-narrowing-conversions-narrowingfloatingpoint-option.cpp
│ ├── cppcoreguidelines-narrowing-conversions-pedanticmode-option.cpp
│ ├── cppcoreguidelines-narrowing-conversions-unsigned-char.cpp
│ ├── cppcoreguidelines-narrowing-conversions.cpp
│ ├── cppcoreguidelines-no-malloc-custom.cpp
│ ├── cppcoreguidelines-no-malloc-no-functions.cpp
│ ├── cppcoreguidelines-no-malloc.cpp
│ ├── cppcoreguidelines-owning-memory-containers.cpp
│ ├── cppcoreguidelines-owning-memory-legacy-functions.cpp
│ ├── cppcoreguidelines-owning-memory.cpp
│ ├── cppcoreguidelines-pro-bounds-array-to-pointer-decay.cpp
│ ├── cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp
│ ├── cppcoreguidelines-pro-bounds-constant-array-index-gslheader.cpp
│ ├── cppcoreguidelines-pro-bounds-constant-array-index.cpp
│ ├── cppcoreguidelines-pro-bounds-pointer-arithmetic-pr36489.cpp
│ ├── cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp
│ ├── cppcoreguidelines-pro-type-const-cast.cpp
│ ├── cppcoreguidelines-pro-type-cstyle-cast.cpp
│ ├── cppcoreguidelines-pro-type-member-init-cxx2a.cpp
│ ├── cppcoreguidelines-pro-type-member-init-cxx98.cpp
│ ├── cppcoreguidelines-pro-type-member-init-delayed.cpp
│ ├── cppcoreguidelines-pro-type-member-init-use-assignment.cpp
│ ├── cppcoreguidelines-pro-type-member-init.cpp
│ ├── cppcoreguidelines-pro-type-reinterpret-cast.cpp
│ ├── cppcoreguidelines-pro-type-static-cast-downcast.cpp
│ ├── cppcoreguidelines-pro-type-union-access.cpp
│ ├── cppcoreguidelines-pro-type-vararg.cpp
│ ├── cppcoreguidelines-slicing.cpp
│ ├── cppcoreguidelines-special-member-functions-cxx-03.cpp
│ ├── cppcoreguidelines-special-member-functions-relaxed.cpp
│ ├── cppcoreguidelines-special-member-functions.cpp
│ ├── custom-diagnostics.cpp
│ ├── deduplication.cpp
│ ├── diagnostic.cpp
│ ├── enable-alpha-checks.cpp
│ ├── expand-modular-headers-ppcallbacks.cpp
│ ├── explain-checks.cpp
│ ├── export-diagnostics.cpp
│ ├── export-relpath.cpp
│ ├── extra-args.cpp
│ ├── file-filter.cpp
│ ├── fix-errors.cpp
│ ├── fix.cpp
│ ├── fuchsia-default-arguments-calls.cpp
│ ├── fuchsia-default-arguments-declarations.cpp
│ ├── fuchsia-multiple-inheritance.cpp
│ ├── fuchsia-overloaded-operator.cpp
│ ├── fuchsia-restrict-system-includes-all.cpp
│ ├── fuchsia-restrict-system-includes-glob.cpp
│ ├── fuchsia-restrict-system-includes-headers.cpp
│ ├── fuchsia-restrict-system-includes.cpp
│ ├── fuchsia-statically-constructed-objects.cpp
│ ├── fuchsia-trailing-return.cpp
│ ├── fuchsia-virtual-inheritance.cpp
│ ├── google-build-explicit-make-pair.cpp
│ ├── google-default-arguments.cpp
│ ├── google-explicit-constructor.cpp
│ ├── google-module.cpp
│ ├── google-namespaces.cpp
│ ├── google-objc-avoid-nsobject-new.m
│ ├── google-objc-avoid-throwing-exception.m
│ ├── google-objc-function-naming.m
│ ├── google-objc-function-naming.mm
│ ├── google-objc-global-variable-declaration.m
│ ├── google-objc-global-variable-declaration.mm
│ ├── google-overloaded-unary-and.cpp
│ ├── google-readability-casting.c
│ ├── google-readability-casting.cpp
│ ├── google-readability-casting.mm
│ ├── google-readability-namespace-comments.cpp
│ ├── google-readability-nested-namespace-comments.cpp
│ ├── google-readability-todo.cpp
│ ├── google-runtime-int-std.cpp
│ ├── google-runtime-int.c
│ ├── google-runtime-int.cpp
│ ├── google-runtime-int.m
│ ├── google-runtime-references.cpp
│ ├── hicpp-exception-baseclass.cpp
│ ├── hicpp-multiway-paths-covered-else.cpp
│ ├── hicpp-multiway-paths-covered.cpp
│ ├── hicpp-no-assembler-msvc.cpp
│ ├── hicpp-no-assembler.cpp
│ ├── hicpp-signed-bitwise-bug34747.cpp
│ ├── hicpp-signed-bitwise-standard-types.cpp
│ ├── hicpp-signed-bitwise-standard-types.h
│ ├── hicpp-signed-bitwise.cpp
│ ├── line-filter.cpp
│ ├── list-checks.cpp
│ ├── llvm-include-order.cpp
│ ├── llvm-prefer-isa-or-dyn-cast-in-conditionals.cpp
│ ├── llvm-twine-local.cpp
│ ├── macros.cpp
│ ├── misc-definitions-in-headers-1z.hpp
│ ├── misc-definitions-in-headers.hpp
│ ├── misc-misplaced-const-cxx17.cpp
│ ├── misc-misplaced-const.c
│ ├── misc-misplaced-const.cpp
│ ├── misc-new-delete-overloads-sized-dealloc.cpp
│ ├── misc-new-delete-overloads.cpp
│ ├── misc-non-copyable-objects.c
│ ├── misc-non-copyable-objects.cpp
│ ├── misc-non-private-member-variables-in-classes.cpp
│ ├── misc-redundant-expression.cpp
│ ├── misc-static-assert.c
│ ├── misc-static-assert.cpp
│ ├── misc-throw-by-value-catch-by-reference.cpp
│ ├── misc-unconventional-assign-operator-cxx17.cpp
│ ├── misc-unconventional-assign-operator.cpp
│ ├── misc-uniqueptr-reset-release.cpp
│ ├── misc-unused-alias-decls.cpp
│ ├── misc-unused-parameters-strict.cpp
│ ├── misc-unused-parameters.c
│ ├── misc-unused-parameters.cpp
│ ├── misc-unused-using-decls-errors.cpp
│ ├── misc-unused-using-decls.cpp
│ ├── modernize-avoid-bind.cpp
│ ├── modernize-avoid-c-arrays-ignores-main.cpp
│ ├── modernize-avoid-c-arrays-ignores-three-arg-main.cpp
│ ├── modernize-avoid-c-arrays.cpp
│ ├── modernize-concat-nested-namespaces.cpp
│ ├── modernize-deprecated-headers-cxx03.cpp
│ ├── modernize-deprecated-headers-cxx11.cpp
│ ├── modernize-deprecated-ios-base-aliases.cpp
│ ├── modernize-loop-convert-assert-failure.cpp
│ ├── modernize-loop-convert-basic.cpp
│ ├── modernize-loop-convert-camelback.cpp
│ ├── modernize-loop-convert-const.cpp
│ ├── modernize-loop-convert-extra.cpp
│ ├── modernize-loop-convert-lowercase.cpp
│ ├── modernize-loop-convert-negative.cpp
│ ├── modernize-loop-convert-uppercase.cpp
│ ├── modernize-loop-convert.c
│ ├── modernize-make-shared-header.cpp
│ ├── modernize-make-shared.cpp
│ ├── modernize-make-unique-cxx11.cpp
│ ├── modernize-make-unique-header.cpp
│ ├── modernize-make-unique-inaccessible-ctors.cpp
│ ├── modernize-make-unique-macros.cpp
│ ├── modernize-make-unique.cpp
│ ├── modernize-pass-by-value-header.cpp
│ ├── modernize-pass-by-value-macro-header.cpp
│ ├── modernize-pass-by-value-multi-fixes.cpp
│ ├── modernize-pass-by-value.cpp
│ ├── modernize-raw-string-literal-delimiter.cpp
│ ├── modernize-raw-string-literal-replace-shorter.cpp
│ ├── modernize-raw-string-literal.cpp
│ ├── modernize-redundant-void-arg-delayed.cpp
│ ├── modernize-redundant-void-arg.c
│ ├── modernize-redundant-void-arg.cpp
│ ├── modernize-replace-auto-ptr.cpp
│ ├── modernize-replace-random-shuffle.cpp
│ ├── modernize-return-braced-init-list.cpp
│ ├── modernize-shrink-to-fit.cpp
│ ├── modernize-unary-static-assert.cpp
│ ├── modernize-use-auto-cast-remove-stars.cpp
│ ├── modernize-use-auto-cast.cpp
│ ├── modernize-use-auto-iterator.cpp
│ ├── modernize-use-auto-min-type-name-length.cpp
│ ├── modernize-use-auto-new-remove-stars.cpp
│ ├── modernize-use-auto-new.cpp
│ ├── modernize-use-bool-literals-ignore-macros.cpp
│ ├── modernize-use-bool-literals.cpp
│ ├── modernize-use-default-member-init-assignment.cpp
│ ├── modernize-use-default-member-init-bitfield.cpp
│ ├── modernize-use-default-member-init-macros.cpp
│ ├── modernize-use-default-member-init.cpp
│ ├── modernize-use-emplace-ignore-implicit-constructors.cpp
│ ├── modernize-use-emplace.cpp
│ ├── modernize-use-equals-default-copy.cpp
│ ├── modernize-use-equals-default-delayed.cpp
│ ├── modernize-use-equals-default-macros.cpp
│ ├── modernize-use-equals-default.cpp
│ ├── modernize-use-equals-delete-macros.cpp
│ ├── modernize-use-equals-delete.cpp
│ ├── modernize-use-nodiscard-clang-unused.cpp
│ ├── modernize-use-nodiscard-cxx11.cpp
│ ├── modernize-use-nodiscard-gcc-unused.cpp
│ ├── modernize-use-nodiscard-no-macro-inscope-cxx11.cpp
│ ├── modernize-use-nodiscard-no-macro.cpp
│ ├── modernize-use-nodiscard.cpp
│ ├── modernize-use-noexcept-macro.cpp
│ ├── modernize-use-noexcept-opt.cpp
│ ├── modernize-use-noexcept.cpp
│ ├── modernize-use-nullptr-basic.cpp
│ ├── modernize-use-nullptr.c
│ ├── modernize-use-nullptr.cpp
│ ├── modernize-use-override-cxx98.cpp
│ ├── modernize-use-override-ms.cpp
│ ├── modernize-use-override-no-destructors.cpp
│ ├── modernize-use-override-with-macro.cpp
│ ├── modernize-use-override-with-no-macro-inscope.cpp
│ ├── modernize-use-override.cpp
│ ├── modernize-use-trailing-return-type.cpp
│ ├── modernize-use-transparent-functors.cpp
│ ├── modernize-use-uncaught-exceptions.cpp
│ ├── modernize-use-using-macros.cpp
│ ├── modernize-use-using.cpp
│ ├── mpi-buffer-deref.cpp
│ ├── mpi-type-mismatch.cpp
│ ├── nolint-plugin.cpp
│ ├── nolint.cpp
│ ├── nolintnextline-plugin.cpp
│ ├── nolintnextline.cpp
│ ├── nonstandard-file-extension.test
│ ├── objc-arc-and-properties.m
│ ├── objc-avoid-nserror-init.m
│ ├── objc-avoid-spinlock.m
│ ├── objc-forbidden-subclassing-custom.m
│ ├── objc-forbidden-subclassing.m
│ ├── objc-no-arc-or-properties.m
│ ├── objc-property-declaration.m
│ ├── objc-super-self.m
│ ├── openmp-exception-escape.cpp
│ ├── openmp-use-default-none.cpp
│ ├── overlapping.cpp
│ ├── performance-faster-string-find.cpp
│ ├── performance-for-range-copy-allowed-types.cpp
│ ├── performance-for-range-copy-warn-on-all-auto-copies.cpp
│ ├── performance-for-range-copy.cpp
│ ├── performance-implicit-conversion-in-loop.cpp
│ ├── performance-inefficient-algorithm.cpp
│ ├── performance-inefficient-string-concatenation.cpp
│ ├── performance-inefficient-vector-operation.cpp
│ ├── performance-move-const-arg-trivially-copyable.cpp
│ ├── performance-move-const-arg.cpp
│ ├── performance-move-constructor-init.cpp
│ ├── performance-noexcept-move-constructor.cpp
│ ├── performance-type-promotion-in-math-fn.cpp
│ ├── performance-unnecessary-copy-initialization-allowed-types.cpp
│ ├── performance-unnecessary-copy-initialization.cpp
│ ├── performance-unnecessary-value-param-allowed-types.cpp
│ ├── performance-unnecessary-value-param-arc.m
│ ├── performance-unnecessary-value-param-arc.mm
│ ├── performance-unnecessary-value-param-delayed.cpp
│ ├── performance-unnecessary-value-param-header.cpp
│ ├── performance-unnecessary-value-param-incomplete-type.cpp
│ ├── performance-unnecessary-value-param.cpp
│ ├── portability-simd-intrinsics-ppc.cpp
│ ├── portability-simd-intrinsics-x86.cpp
│ ├── pr37091.cpp
│ ├── read_file_config.cpp
│ ├── readability-avoid-const-params-in-decls.cpp
│ ├── readability-avoid-underscore-in-googletest-name.cpp
│ ├── readability-braces-around-statements-assert-failure.cpp
│ ├── readability-braces-around-statements-few-lines.cpp
│ ├── readability-braces-around-statements-format.cpp
│ ├── readability-braces-around-statements-same-line.cpp
│ ├── readability-braces-around-statements-single-line.cpp
│ ├── readability-braces-around-statements.cpp
│ ├── readability-const-return-type.cpp
│ ├── readability-container-size-empty.cpp
│ ├── readability-delete-null-pointer.cpp
│ ├── readability-deleted-default.cpp
│ ├── readability-else-after-return-if-constexpr.cpp
│ ├── readability-else-after-return.cpp
│ ├── readability-function-size-variables-c++17.cpp
│ ├── readability-function-size.cpp
│ ├── readability-identifier-naming-bugfix.cpp
│ ├── readability-identifier-naming-objc.m
│ ├── readability-identifier-naming.cpp
│ ├── readability-implicit-bool-conversion-allow-in-conditions.cpp
│ ├── readability-implicit-bool-conversion-cxx98.cpp
│ ├── readability-implicit-bool-conversion.cpp
│ ├── readability-inconsistent-declaration-parameter-name-macros.cpp
│ ├── readability-inconsistent-declaration-parameter-name-strict.cpp
│ ├── readability-inconsistent-declaration-parameter-name.cpp
│ ├── readability-isolate-declaration-cxx17.cpp
│ ├── readability-isolate-declaration-fixing.cpp
│ ├── readability-isolate-declaration.c
│ ├── readability-isolate-declaration.cpp
│ ├── readability-magic-numbers.cpp
│ ├── readability-misleading-indentation.cpp
│ ├── readability-misplaced-array-index.cpp
│ ├── readability-named-parameter.cpp
│ ├── readability-non-const-parameter.cpp
│ ├── readability-redundant-control-flow.cpp
│ ├── readability-redundant-declaration-ignore-macros.cpp
│ ├── readability-redundant-declaration.c
│ ├── readability-redundant-declaration.cpp
│ ├── readability-redundant-function-ptr-dereference.cpp
│ ├── readability-redundant-member-init.cpp
│ ├── readability-redundant-preprocessor-ifdef.cpp
│ ├── readability-redundant-preprocessor.cpp
│ ├── readability-redundant-preprocessor.h
│ ├── readability-redundant-smartptr-get-macros.cpp
│ ├── readability-redundant-smartptr-get-msvc.cpp
│ ├── readability-redundant-smartptr-get.cpp
│ ├── readability-redundant-string-cstr-msvc.cpp
│ ├── readability-redundant-string-cstr.cpp
│ ├── readability-redundant-string-init-msvc.cpp
│ ├── readability-redundant-string-init.cpp
│ ├── readability-simplify-bool-expr-chained-conditional-assignment.cpp
│ ├── readability-simplify-bool-expr-chained-conditional-return.cpp
│ ├── readability-simplify-bool-expr-members.cpp
│ ├── readability-simplify-bool-expr.cpp
│ ├── readability-simplify-subscript-expr.cpp
│ ├── readability-static-accessed-through-instance-nesting-threshold.cpp
│ ├── readability-static-accessed-through-instance.cpp
│ ├── readability-static-definition-in-anonymous-namespace.cpp
│ ├── readability-string-compare.cpp
│ ├── readability-uniqueptr-delete-release.cpp
│ ├── readability-uppercase-literal-suffix-float16.cpp
│ ├── readability-uppercase-literal-suffix-floating-point-opencl-half.cpp
│ ├── readability-uppercase-literal-suffix-floating-point.cpp
│ ├── readability-uppercase-literal-suffix-hexadecimal-floating-point.cpp
│ ├── readability-uppercase-literal-suffix-integer-custom-list.cpp
│ ├── readability-uppercase-literal-suffix-integer-macro.cpp
│ ├── readability-uppercase-literal-suffix-integer-ms.cpp
│ ├── readability-uppercase-literal-suffix-integer.cpp
│ ├── readability-uppercase-literal-suffix.h
│ ├── run-clang-tidy.cpp
│ ├── select-checks.cpp
│ ├── serialize-diagnostics.cpp
│ ├── static-analyzer-config.cpp
│ ├── static-analyzer.cpp
│ ├── temporaries.cpp
│ ├── validate-check-names.cpp
│ ├── vfsoverlay.cpp
│ ├── warnings-as-errors-diagnostics.cpp
│ ├── warnings-as-errors-plural.cpp
│ ├── warnings-as-errors.cpp
│ └── zircon-temporary-objects.cpp
├── lit.cfg.py
├── lit.site.cfg.py.in
├── modularize
│ ├── Inputs
│ │ ├── Anonymous.h
│ │ ├── CompileError
│ │ │ ├── HasError.h
│ │ │ ├── Level1A.h
│ │ │ └── module.modulemap
│ │ ├── CoverageNoProblems
│ │ │ ├── Includes1
│ │ │ │ ├── .hidden
│ │ │ │ │ └── DontFindMe.h
│ │ │ │ └── Level1A.h
│ │ │ ├── Includes2
│ │ │ │ └── Level2A.h
│ │ │ ├── NonIncludes
│ │ │ │ └── Level3A.h
│ │ │ └── module.modulemap
│ │ ├── CoverageProblems
│ │ │ ├── Level1A.h
│ │ │ ├── Level1B.h
│ │ │ ├── Level2A.h
│ │ │ ├── Level2B.h
│ │ │ ├── Level3A.h
│ │ │ ├── Level3B
│ │ │ ├── Sub
│ │ │ │ └── Level3B.h
│ │ │ ├── UmbrellaFile.h
│ │ │ ├── UmbrellaInclude1.h
│ │ │ ├── UmbrellaInclude2.h
│ │ │ ├── UmbrellaSub
│ │ │ │ ├── Umbrell1.h
│ │ │ │ └── Umbrell2.h
│ │ │ └── module.modulemap
│ │ ├── DuplicateHeader1.h
│ │ ├── DuplicateHeader2.h
│ │ ├── Empty.h
│ │ ├── HeaderGuard.h
│ │ ├── HeaderGuardSub1.h
│ │ ├── HeaderGuardSub2.h
│ │ ├── HeaderGuardSubSub.h
│ │ ├── HeaderGuardSubSubDefined.h
│ │ ├── IncludeInExtern.h
│ │ ├── IncludeInNamespace.h
│ │ ├── InconsistentHeader1.h
│ │ ├── InconsistentHeader2.h
│ │ ├── InconsistentSubHeader.h
│ │ ├── IsDependent.h
│ │ ├── MissingHeader
│ │ │ ├── Level1A.h
│ │ │ └── module.modulemap
│ │ ├── NamespaceClasses.h
│ │ ├── NestedMacro.h
│ │ ├── NoProblems.modulemap
│ │ ├── ProblemsDuplicate.modulemap
│ │ ├── SomeDecls.h
│ │ ├── SomeOtherTypes.h
│ │ ├── SomeTypes.h
│ │ ├── SubModule1
│ │ │ ├── Header1.h
│ │ │ └── Header2.h
│ │ ├── SubModule2
│ │ │ ├── Header3.h
│ │ │ └── Header4.h
│ │ └── TemplateClasses.h
│ ├── NoProblems.modularize
│ ├── NoProblemsAnonymous.modularize
│ ├── NoProblemsAssistant.modularize
│ ├── NoProblemsCoverage.modularize
│ ├── NoProblemsDependencies.modularize
│ ├── NoProblemsGuard.modularize
│ ├── NoProblemsList.modularize
│ ├── NoProblemsNamespace.modularize
│ ├── NoProblemsNamespaceClasses.modularize
│ ├── NoProblemsNestedMacro.modularize
│ ├── NoProblemsTemplateClasses.modularize
│ ├── ProblemsCompileError.modularize
│ ├── ProblemsCoverage.modularize
│ ├── ProblemsDisplayLists.modularize
│ ├── ProblemsDuplicate.modularize
│ ├── ProblemsExternC.modularize
│ ├── ProblemsInconsistent.modularize
│ ├── ProblemsMissingHeader.modularize
│ ├── ProblemsNamespace.modularize
│ └── SubModule2.h
└── pp-trace
│ ├── Inputs
│ ├── Level1A.h
│ ├── Level1B.h
│ ├── Level2A.h
│ ├── Level2B.h
│ ├── ModularizeList.txt
│ └── module.map
│ ├── pp-trace-conditional.cpp
│ ├── pp-trace-filter.cpp
│ ├── pp-trace-ident.cpp
│ ├── pp-trace-include.cpp
│ ├── pp-trace-macro.cpp
│ ├── pp-trace-modules.cpp
│ ├── pp-trace-pragma-general.cpp
│ ├── pp-trace-pragma-ms.cpp
│ └── pp-trace-pragma-opencl.cpp
├── tool-template
├── CMakeLists.txt
└── ToolTemplate.cpp
└── unittests
├── CMakeLists.txt
├── clang-apply-replacements
├── ApplyReplacementsTest.cpp
└── CMakeLists.txt
├── clang-change-namespace
├── CMakeLists.txt
└── ChangeNamespaceTests.cpp
├── clang-doc
├── BitcodeTest.cpp
├── CMakeLists.txt
├── ClangDocTest.cpp
├── ClangDocTest.h
├── MDGeneratorTest.cpp
├── MergeTest.cpp
├── SerializeTest.cpp
└── YAMLGeneratorTest.cpp
├── clang-include-fixer
├── CMakeLists.txt
├── FuzzySymbolIndexTests.cpp
├── IncludeFixerTest.cpp
└── find-all-symbols
│ ├── CMakeLists.txt
│ └── FindAllSymbolsTests.cpp
├── clang-move
├── CMakeLists.txt
└── ClangMoveTests.cpp
├── clang-query
├── CMakeLists.txt
├── QueryEngineTest.cpp
└── QueryParserTest.cpp
├── clang-tidy
├── CMakeLists.txt
├── ClangTidyDiagnosticConsumerTest.cpp
├── ClangTidyOptionsTest.cpp
├── ClangTidyTest.h
├── GoogleModuleTest.cpp
├── IncludeInserterTest.cpp
├── LLVMModuleTest.cpp
├── NamespaceAliaserTest.cpp
├── ObjCModuleTest.cpp
├── OverlappingReplacementsTest.cpp
├── ReadabilityModuleTest.cpp
├── TransformerClangTidyCheckTest.cpp
└── UsingInserterTest.cpp
└── include
└── common
└── VirtualFileHelper.h
/.arcconfig:
--------------------------------------------------------------------------------
1 | {
2 | "repository.callsign" : "CTE",
3 | "conduit_uri" : "https://reviews.llvm.org/"
4 | }
5 |
--------------------------------------------------------------------------------
/clang-apply-replacements/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Support
3 | )
4 |
5 | add_clang_library(clangApplyReplacements
6 | lib/Tooling/ApplyReplacements.cpp
7 |
8 | LINK_LIBS
9 | clangAST
10 | clangBasic
11 | clangRewrite
12 | clangToolingCore
13 | clangToolingRefactor
14 | )
15 |
16 | include_directories(
17 | ${CMAKE_CURRENT_SOURCE_DIR}
18 | include
19 | )
20 | add_subdirectory(tool)
21 |
--------------------------------------------------------------------------------
/clang-apply-replacements/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Support
3 | )
4 |
5 | add_clang_tool(clang-apply-replacements
6 | ClangApplyReplacementsMain.cpp
7 | )
8 | target_link_libraries(clang-apply-replacements
9 | PRIVATE
10 | clangApplyReplacements
11 | clangBasic
12 | clangFormat
13 | clangRewrite
14 | clangToolingCore
15 | clangToolingRefactoring
16 | )
17 |
18 | install(TARGETS clang-apply-replacements
19 | RUNTIME DESTINATION bin)
20 |
--------------------------------------------------------------------------------
/clang-change-namespace/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | add_clang_library(clangChangeNamespace
6 | ChangeNamespace.cpp
7 |
8 | LINK_LIBS
9 | clangAST
10 | clangASTMatchers
11 | clangBasic
12 | clangFormat
13 | clangFrontend
14 | clangLex
15 | clangSerialization
16 | clangTooling
17 | clangToolingCore
18 | )
19 |
20 | add_subdirectory(tool)
21 |
--------------------------------------------------------------------------------
/clang-change-namespace/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
2 |
3 | set(LLVM_LINK_COMPONENTS
4 | Support
5 | )
6 |
7 | add_clang_executable(clang-change-namespace
8 | ClangChangeNamespace.cpp
9 | )
10 | target_link_libraries(clang-change-namespace
11 | PRIVATE
12 | clangAST
13 | clangASTMatchers
14 | clangBasic
15 | clangChangeNamespace
16 | clangFormat
17 | clangFrontend
18 | clangRewrite
19 | clangSerialization
20 | clangTooling
21 | clangToolingCore
22 | )
23 |
24 | install(TARGETS clang-change-namespace
25 | RUNTIME DESTINATION bin)
26 |
--------------------------------------------------------------------------------
/clang-doc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | BitReader
4 | BitWriter
5 | )
6 |
7 | add_clang_library(clangDoc
8 | BitcodeReader.cpp
9 | BitcodeWriter.cpp
10 | ClangDoc.cpp
11 | Generators.cpp
12 | Mapper.cpp
13 | MDGenerator.cpp
14 | Representation.cpp
15 | Serialize.cpp
16 | YAMLGenerator.cpp
17 |
18 | LINK_LIBS
19 | clangAnalysis
20 | clangAST
21 | clangASTMatchers
22 | clangBasic
23 | clangFrontend
24 | clangIndex
25 | clangLex
26 | clangTooling
27 | clangToolingCore
28 | )
29 |
30 | add_subdirectory(tool)
31 |
--------------------------------------------------------------------------------
/clang-doc/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
2 |
3 | add_clang_tool(clang-doc
4 | ClangDocMain.cpp
5 | )
6 |
7 | target_link_libraries(clang-doc
8 | PRIVATE
9 | clangAST
10 | clangASTMatchers
11 | clangBasic
12 | clangFrontend
13 | clangDoc
14 | clangTooling
15 | clangToolingCore
16 | )
17 |
--------------------------------------------------------------------------------
/clang-include-fixer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | add_clang_library(clangIncludeFixer
6 | IncludeFixer.cpp
7 | IncludeFixerContext.cpp
8 | InMemorySymbolIndex.cpp
9 | FuzzySymbolIndex.cpp
10 | SymbolIndexManager.cpp
11 | YamlSymbolIndex.cpp
12 |
13 | LINK_LIBS
14 | clangAST
15 | clangBasic
16 | clangFormat
17 | clangFrontend
18 | clangLex
19 | clangParse
20 | clangSema
21 | clangSerialization
22 | clangTooling
23 | clangToolingCore
24 | findAllSymbols
25 | )
26 |
27 | add_subdirectory(plugin)
28 | add_subdirectory(tool)
29 | add_subdirectory(find-all-symbols)
30 |
--------------------------------------------------------------------------------
/clang-include-fixer/find-all-symbols/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Support
3 | )
4 |
5 | add_clang_library(findAllSymbols
6 | FindAllSymbols.cpp
7 | FindAllSymbolsAction.cpp
8 | FindAllMacros.cpp
9 | HeaderMapCollector.cpp
10 | PathConfig.cpp
11 | PragmaCommentHandler.cpp
12 | STLPostfixHeaderMap.cpp
13 | SymbolInfo.cpp
14 |
15 | LINK_LIBS
16 | clangAST
17 | clangASTMatchers
18 | clangBasic
19 | clangFrontend
20 | clangLex
21 | clangTooling
22 | )
23 |
24 | add_subdirectory(tool)
25 |
--------------------------------------------------------------------------------
/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
2 |
3 | add_clang_executable(find-all-symbols
4 | FindAllSymbolsMain.cpp
5 | )
6 |
7 | target_link_libraries(find-all-symbols
8 | PRIVATE
9 | clangAST
10 | clangASTMatchers
11 | clangBasic
12 | clangFrontend
13 | clangLex
14 | clangSerialization
15 | clangTooling
16 | findAllSymbols
17 | )
18 |
19 | install(TARGETS find-all-symbols
20 | RUNTIME DESTINATION bin)
21 |
22 | install(PROGRAMS run-find-all-symbols.py
23 | DESTINATION share/clang
24 | COMPONENT find-all-symbols)
25 |
--------------------------------------------------------------------------------
/clang-include-fixer/plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_clang_library(clangIncludeFixerPlugin
2 | IncludeFixerPlugin.cpp
3 |
4 | LINK_LIBS
5 | clangAST
6 | clangBasic
7 | clangFrontend
8 | clangIncludeFixer
9 | clangParse
10 | clangSema
11 | clangTooling
12 | ${LLVM_PTHREAD_LIB}
13 | )
14 |
--------------------------------------------------------------------------------
/clang-move/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | add_clang_library(clangMove
6 | Move.cpp
7 | HelperDeclRefGraph.cpp
8 |
9 | LINK_LIBS
10 | clangAnalysis
11 | clangAST
12 | clangASTMatchers
13 | clangBasic
14 | clangFormat
15 | clangFrontend
16 | clangLex
17 | clangSerialization
18 | clangTooling
19 | clangToolingCore
20 | )
21 |
22 | add_subdirectory(tool)
23 |
--------------------------------------------------------------------------------
/clang-move/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
2 |
3 | add_clang_executable(clang-move
4 | ClangMove.cpp
5 | )
6 |
7 | target_link_libraries(clang-move
8 | PRIVATE
9 | clangAST
10 | clangASTMatchers
11 | clangBasic
12 | clangFormat
13 | clangFrontend
14 | clangMove
15 | clangRewrite
16 | clangSerialization
17 | clangTooling
18 | clangToolingCore
19 | )
20 |
--------------------------------------------------------------------------------
/clang-query/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | lineeditor
3 | support
4 | )
5 |
6 | add_clang_library(clangQuery
7 | Query.cpp
8 | QueryParser.cpp
9 |
10 | LINK_LIBS
11 | clangAST
12 | clangASTMatchers
13 | clangBasic
14 | clangDynamicASTMatchers
15 | clangFrontend
16 | clangSerialization
17 | )
18 |
19 | add_subdirectory(tool)
20 |
--------------------------------------------------------------------------------
/clang-query/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
2 |
3 | add_clang_executable(clang-query
4 | ClangQuery.cpp
5 | )
6 | target_link_libraries(clang-query
7 | PRIVATE
8 | clangAST
9 | clangASTMatchers
10 | clangBasic
11 | clangDynamicASTMatchers
12 | clangFrontend
13 | clangQuery
14 | clangSerialization
15 | clangTooling
16 | )
17 |
18 | install(TARGETS clang-query RUNTIME DESTINATION bin)
19 |
--------------------------------------------------------------------------------
/clang-reorder-fields/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangReorderFields
4 | ReorderFieldsAction.cpp
5 |
6 | LINK_LIBS
7 | clangAST
8 | clangASTMatchers
9 | clangBasic
10 | clangIndex
11 | clangLex
12 | clangSerialization
13 | clangToolingCore
14 | )
15 |
16 | add_subdirectory(tool)
17 |
--------------------------------------------------------------------------------
/clang-reorder-fields/tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_clang_tool(clang-reorder-fields
2 | ClangReorderFields.cpp
3 | )
4 |
5 | target_link_libraries(clang-reorder-fields
6 | PRIVATE
7 | clangBasic
8 | clangFrontend
9 | clangReorderFields
10 | clangRewrite
11 | clangSerialization
12 | clangTooling
13 | clangToolingCore
14 | )
15 |
--------------------------------------------------------------------------------
/clang-tidy-vs/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | bin/
3 | .vs/
4 | Key.snk
5 | clang-tidy.exe
6 | packages/
7 | *.csproj.user
8 |
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/ClangTidyCheckAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace LLVM.ClangTidy
8 | {
9 | public class ClangTidyCheckAttribute : Attribute
10 | {
11 | private string CheckName_;
12 | public ClangTidyCheckAttribute(string CheckName)
13 | {
14 | this.CheckName_ = CheckName;
15 | }
16 |
17 | public string CheckName
18 | {
19 | get { return CheckName_; }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/Guids.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LLVM.ClangTidy
4 | {
5 | static class GuidList
6 | {
7 | public const string guidClangTidyPkgString = "AE4956BE-3DB8-430E-BBAB-7E2E9A014E9C";
8 | public const string guidClangTidyCmdSetString = "9E0F0493-6493-46DE-AEE1-ACD8F60F265E";
9 |
10 | public static readonly Guid guidClangTidyCmdSet = new Guid(guidClangTidyCmdSetString);
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | namespace LLVM.ClangTidy
2 | {
3 | static class PkgCmdIDList
4 | {
5 | public const uint cmdidClangTidy = 0x100;
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/Resources/Images_32bit.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/clang-tidy-vs/ClangTidy/Resources/Images_32bit.bmp
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/clang-tidy-vs/ClangTidy/Resources/Package.ico
--------------------------------------------------------------------------------
/clang-tidy-vs/ClangTidy/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/clang-tidy/boost/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyBoostModule
4 | BoostTidyModule.cpp
5 | UseToStringCheck.cpp
6 |
7 | LINK_LIBS
8 | clangAST
9 | clangASTMatchers
10 | clangBasic
11 | clangLex
12 | clangTidy
13 | clangTidyUtils
14 | )
15 |
--------------------------------------------------------------------------------
/clang-tidy/fuchsia/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyFuchsiaModule
4 | DefaultArgumentsCallsCheck.cpp
5 | DefaultArgumentsDeclarationsCheck.cpp
6 | FuchsiaTidyModule.cpp
7 | MultipleInheritanceCheck.cpp
8 | OverloadedOperatorCheck.cpp
9 | RestrictSystemIncludesCheck.cpp
10 | StaticallyConstructedObjectsCheck.cpp
11 | TrailingReturnCheck.cpp
12 | VirtualInheritanceCheck.cpp
13 |
14 | LINK_LIBS
15 | clangAST
16 | clangASTMatchers
17 | clangBasic
18 | clangLex
19 | clangTidy
20 | clangTidyGoogleModule
21 | clangTidyUtils
22 | )
23 |
--------------------------------------------------------------------------------
/clang-tidy/hicpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyHICPPModule
4 | ExceptionBaseclassCheck.cpp
5 | HICPPTidyModule.cpp
6 | MultiwayPathsCoveredCheck.cpp
7 | NoAssemblerCheck.cpp
8 | SignedBitwiseCheck.cpp
9 |
10 | LINK_LIBS
11 | clangAST
12 | clangASTMatchers
13 | clangBasic
14 | clangLex
15 | clangSerialization
16 | clangTidy
17 | clangTidyBugproneModule
18 | clangTidyCppCoreGuidelinesModule
19 | clangTidyGoogleModule
20 | clangTidyMiscModule
21 | clangTidyModernizeModule
22 | clangTidyPerformanceModule
23 | clangTidyReadabilityModule
24 | clangTidyUtils
25 | )
26 |
--------------------------------------------------------------------------------
/clang-tidy/hicpp/LICENSE.TXT:
--------------------------------------------------------------------------------
1 | ------------------------------------------------------------------------------
2 | clang-tidy High-Integrity C++ Files
3 | ------------------------------------------------------------------------------
4 | All clang-tidy files are licensed under the same terms as the rest of the LLVM
5 | project with the following additions:
6 |
7 | Any file referencing a High-Integrity C++ Coding guideline:
8 |
9 | HIC++ Coding Standard as created by PRQA.
10 |
11 | Please see http://www.codingstandard.com/section/conditions-of-use/ for more
12 | information.
13 |
--------------------------------------------------------------------------------
/clang-tidy/llvm/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyLLVMModule
4 | HeaderGuardCheck.cpp
5 | IncludeOrderCheck.cpp
6 | LLVMTidyModule.cpp
7 | PreferIsaOrDynCastInConditionalsCheck.cpp
8 | TwineLocalCheck.cpp
9 |
10 | LINK_LIBS
11 | clangAST
12 | clangASTMatchers
13 | clangBasic
14 | clangLex
15 | clangTidy
16 | clangTidyReadabilityModule
17 | clangTidyUtils
18 | clangTooling
19 | )
20 |
--------------------------------------------------------------------------------
/clang-tidy/mpi/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyMPIModule
4 | BufferDerefCheck.cpp
5 | MPITidyModule.cpp
6 | TypeMismatchCheck.cpp
7 |
8 | LINK_LIBS
9 | clangAnalysis
10 | clangAST
11 | clangASTMatchers
12 | clangBasic
13 | clangLex
14 | clangTidy
15 | clangTidyUtils
16 | clangTooling
17 | clangStaticAnalyzerCheckers
18 | )
19 |
--------------------------------------------------------------------------------
/clang-tidy/objc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyObjCModule
4 | AvoidNSErrorInitCheck.cpp
5 | AvoidSpinlockCheck.cpp
6 | ForbiddenSubclassingCheck.cpp
7 | ObjCTidyModule.cpp
8 | PropertyDeclarationCheck.cpp
9 | SuperSelfCheck.cpp
10 |
11 | LINK_LIBS
12 | clangAST
13 | clangASTMatchers
14 | clangBasic
15 | clangLex
16 | clangTidy
17 | clangTidyUtils
18 | )
19 |
--------------------------------------------------------------------------------
/clang-tidy/openmp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyOpenMPModule
4 | ExceptionEscapeCheck.cpp
5 | OpenMPTidyModule.cpp
6 | UseDefaultNoneCheck.cpp
7 |
8 | LINK_LIBS
9 | clangAST
10 | clangASTMatchers
11 | clangBasic
12 | clangTidy
13 | clangTidyUtils
14 | )
15 |
--------------------------------------------------------------------------------
/clang-tidy/portability/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyPortabilityModule
4 | PortabilityTidyModule.cpp
5 | SIMDIntrinsicsCheck.cpp
6 |
7 | LINK_LIBS
8 | clangAST
9 | clangASTMatchers
10 | clangBasic
11 | clangLex
12 | clangTidy
13 | clangTidyUtils
14 | clangTooling
15 | )
16 |
--------------------------------------------------------------------------------
/clang-tidy/utils/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyUtils
4 | ASTUtils.cpp
5 | DeclRefExprUtils.cpp
6 | ExceptionAnalyzer.cpp
7 | ExprSequence.cpp
8 | FixItHintUtils.cpp
9 | HeaderFileExtensionsUtils.cpp
10 | HeaderGuard.cpp
11 | IncludeInserter.cpp
12 | IncludeSorter.cpp
13 | LexerUtils.cpp
14 | NamespaceAliaser.cpp
15 | OptionsUtils.cpp
16 | TransformerClangTidyCheck.cpp
17 | TypeTraits.cpp
18 | UsingInserter.cpp
19 |
20 | LINK_LIBS
21 | clangAST
22 | clangASTMatchers
23 | clangBasic
24 | clangLex
25 | clangTidy
26 | clangToolingRefactoring
27 | )
28 |
--------------------------------------------------------------------------------
/clang-tidy/zircon/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS support)
2 |
3 | add_clang_library(clangTidyZirconModule
4 | TemporaryObjectsCheck.cpp
5 | ZirconTidyModule.cpp
6 |
7 | LINK_LIBS
8 | clangAST
9 | clangASTMatchers
10 | clangBasic
11 | clangLex
12 | clangTidy
13 | clangTidyUtils
14 | )
15 |
--------------------------------------------------------------------------------
/clangd/Features.inc.in:
--------------------------------------------------------------------------------
1 | #define CLANGD_BUILD_XPC @CLANGD_BUILD_XPC@
2 |
--------------------------------------------------------------------------------
/clangd/benchmarks/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
2 |
3 | add_benchmark(IndexBenchmark IndexBenchmark.cpp)
4 |
5 | target_link_libraries(IndexBenchmark
6 | PRIVATE
7 | clangDaemon
8 | LLVMSupport
9 | )
10 |
--------------------------------------------------------------------------------
/clangd/clients/clangd-vscode/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | node_modules
3 |
--------------------------------------------------------------------------------
/clangd/clients/clangd-vscode/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "out": false // set this to true to hide the "out" folder with the compiled JS files
5 | },
6 | "search.exclude": {
7 | "out": true // set this to false to include "out" folder in search results
8 | }
9 | }
--------------------------------------------------------------------------------
/clangd/clients/clangd-vscode/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | out/test/**
4 | test/**
5 | src/**
6 | **/*.map
7 | .gitignore
8 | tsconfig.json
9 | vsc-extension-quickstart.md
10 |
--------------------------------------------------------------------------------
/clangd/clients/clangd-vscode/test/extension.test.ts:
--------------------------------------------------------------------------------
1 | /** The module 'assert' provides assertion methods from node */
2 | import * as assert from 'assert';
3 |
4 | import * as vscode from 'vscode';
5 | import * as myExtension from '../src/extension';
6 |
7 | // TODO: add tests
8 | suite("Extension Tests", () => {
9 |
10 | // Defines a Mocha unit test
11 | test("Something 1", () => {
12 | assert.equal(-1, [1, 2, 3].indexOf(5));
13 | assert.equal(-1, [1, 2, 3].indexOf(0));
14 | });
15 | });
--------------------------------------------------------------------------------
/clangd/fuzzer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..
2 | ${CMAKE_CURRENT_BINARY_DIR}/..)
3 |
4 | set(LLVM_LINK_COMPONENTS
5 | FuzzMutate
6 | Support
7 | )
8 |
9 | # This fuzzer runs on oss-fuzz, so keep it around even if it looks unreferenced.
10 | add_llvm_fuzzer(clangd-fuzzer
11 | clangd-fuzzer.cpp
12 | DUMMY_MAIN DummyClangdMain.cpp
13 | )
14 |
15 | target_link_libraries(clangd-fuzzer
16 | PRIVATE
17 | clangBasic
18 | clangDaemon
19 | clangFormat
20 | clangFrontend
21 | clangSema
22 | clangTooling
23 | clangToolingCore
24 | )
25 |
--------------------------------------------------------------------------------
/clangd/index/dex/dexp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
2 |
3 | set(LLVM_LINK_COMPONENTS
4 | LineEditor
5 | Support
6 | )
7 |
8 | add_clang_executable(dexp
9 | Dexp.cpp
10 | )
11 |
12 | target_link_libraries(dexp
13 | PRIVATE
14 | clangBasic
15 | clangDaemon
16 | )
17 |
--------------------------------------------------------------------------------
/clangd/indexer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
2 |
3 | set(LLVM_LINK_COMPONENTS
4 | Support
5 | )
6 |
7 | add_clang_executable(clangd-indexer
8 | IndexerMain.cpp
9 | )
10 |
11 | target_link_libraries(clangd-indexer
12 | PRIVATE
13 | clangAST
14 | clangBasic
15 | clangDaemon
16 | clangFrontend
17 | clangIndex
18 | clangLex
19 | clangTooling
20 | )
21 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/BenchmarkHeader.h:
--------------------------------------------------------------------------------
1 | namespace clang {
2 | namespace clangd {
3 | namespace dex {
4 | class Dex;
5 | } // namespace dex
6 | } // namespace clangd
7 | } // namespace clang
8 |
9 | namespace llvm {
10 | namespace sys {
11 |
12 | int getHostNumPhysicalCores();
13 |
14 | } // namespace sys
15 | } // namespace llvm
16 |
17 | namespace {
18 | int Variable;
19 | } // namespace
20 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/BenchmarkSource.cpp:
--------------------------------------------------------------------------------
1 | #include "BenchmarkHeader.h"
2 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/background-index/compile_commands.json:
--------------------------------------------------------------------------------
1 | [{
2 | "directory": "DIRECTORY",
3 | "command": "clang foo.cpp",
4 | "file": "DIRECTORY/foo.cpp"
5 | }]
6 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/background-index/foo.cpp:
--------------------------------------------------------------------------------
1 | #include "foo.h"
2 | int foo() { return 42; }
3 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/background-index/foo.h:
--------------------------------------------------------------------------------
1 | #ifndef FOO_H
2 | #define FOO_H
3 | int foo();
4 | #endif
5 |
--------------------------------------------------------------------------------
/clangd/test/Inputs/symbols.test.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | !Symbol
3 | ID: 057557CEBF6E6B2D
4 | Name: 'vector'
5 | Scope: 'std::'
6 | SymInfo:
7 | Kind: Class
8 | Lang: Cpp
9 | CanonicalDeclaration:
10 | FileURI: 'file:///vector.h'
11 | Start:
12 | Line: 215
13 | Column: 10
14 | End:
15 | Line: 215
16 | Column: 16
17 | ...
18 |
--------------------------------------------------------------------------------
/clangd/test/delimited-input-comment-at-the-end.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s
2 | # RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
3 | #
4 | # RUN: clangd -lit-test -input-mirror-file %t < %s
5 | # RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
6 | #
7 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
8 | ---
9 | {"jsonrpc":"2.0","id":3,"method":"shutdown"}
10 | ---
11 | {"jsonrpc":"2.0","method":"exit"}
12 |
--------------------------------------------------------------------------------
/clangd/test/exit-with-shutdown.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -lit-test < %s
2 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
3 | ---
4 | {"jsonrpc":"2.0","id":3,"method":"shutdown"}
5 | ---
6 | {"jsonrpc":"2.0","method":"exit"}
7 |
--------------------------------------------------------------------------------
/clangd/test/exit-without-shutdown.test:
--------------------------------------------------------------------------------
1 | # RUN: not clangd -lit-test < %s
2 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
3 | ---
4 | {"jsonrpc":"2.0","method":"exit"}
5 |
--------------------------------------------------------------------------------
/clangd/test/index-tools.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd-indexer %p/Inputs/BenchmarkSource.cpp -- -I%p/Inputs > %t.index
2 | # FIXME: By default, benchmarks are excluded from the list of default targets hence not built. Find a way to depend on benchmarks to run the next command.
3 | # REQUIRES: shell
4 | # RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then %clangd-benchmark-dir/IndexBenchmark %t.index %p/Inputs/requests.json --benchmark_min_time=0.01 ; fi
5 | # Pass invalid JSON file and check that IndexBenchmark fails to parse it.
6 | # RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then not %clangd-benchmark-dir/IndexBenchmark %t.index %t --benchmark_min_time=0.01 ; fi
7 |
--------------------------------------------------------------------------------
/clangd/test/initialize-params-invalid.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 | # Test with invalid initialize request parameters
3 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":"","rootUri":"test:///workspace","capabilities":{},"trace":"off"}}
4 | # CHECK: "id": 0,
5 | # CHECK-NEXT: "jsonrpc": "2.0",
6 | # CHECK-NEXT: "result": {
7 | # CHECK-NEXT: "capabilities": {
8 | # ...
9 | ---
10 | {"jsonrpc":"2.0","id":3,"method":"shutdown"}
11 | ---
12 | {"jsonrpc":"2.0","method":"exit"}
13 |
--------------------------------------------------------------------------------
/clangd/test/lit.local.cfg:
--------------------------------------------------------------------------------
1 | import re
2 | # We rely on the default -std being derived from the filetype.
3 | # PS4 sets a different -std, and many tests break.
4 | # FIXME: make our tests less brittle instead.
5 | if re.match(r'.*-scei-ps4', config.target_triple):
6 | config.unsupported = True
7 |
--------------------------------------------------------------------------------
/clangd/test/spaces-in-delimited-input.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s
2 | # RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s
3 | #
4 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
5 |
6 | ---
7 |
8 | {"jsonrpc":"2.0","id":3,"method":"shutdown"}
9 |
10 | ---
11 |
12 | {"jsonrpc":"2.0","method":"exit"}
13 | # CHECK-NOT: JSON parse error
14 |
--------------------------------------------------------------------------------
/clangd/test/test-uri-posix.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 | # UNSUPPORTED: windows-gnu,windows-msvc
3 | # Test authority-less URI
4 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
5 | ---
6 | {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","version":1,"text":"void main() {}"}}}
7 | # CHECK: "uri": "file:///clangd-test/foo.c"
8 | ---
9 | {"jsonrpc":"2.0","id":5,"method":"shutdown"}
10 | ---
11 | {"jsonrpc":"2.0","method":"exit"}
12 |
--------------------------------------------------------------------------------
/clangd/test/test-uri-windows.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 | # REQUIRES: windows-gnu || windows-msvc
3 | # Test authority-less URI
4 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
5 | ---
6 | {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///foo.c","languageId":"c","version":1,"text":"void main() {}"}}}
7 | # CHECK: "uri": "file:///C:/clangd-test/foo.c"
8 | ---
9 | {"jsonrpc":"2.0","id":5,"method":"shutdown"}
10 | ---
11 | {"jsonrpc":"2.0","method":"exit"}
12 |
--------------------------------------------------------------------------------
/clangd/test/too_large.test:
--------------------------------------------------------------------------------
1 | # RUN: not clangd -sync < %s 2>&1 | FileCheck -check-prefix=STDERR %s
2 | # vim: fileformat=dos
3 | # It is absolutely vital that this file has CRLF line endings.
4 | #
5 | Content-Length: 2147483648
6 |
7 | # STDERR: Refusing to read message
8 |
--------------------------------------------------------------------------------
/clangd/test/xpc/initialize.test:
--------------------------------------------------------------------------------
1 | # RUN: clangd-xpc-test-client < %s | FileCheck %s
2 | # REQUIRES: clangd-xpc-support
3 |
4 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootUri":"test:///workspace","capabilities":{},"trace":"off"}}
5 | # CHECK: {"id":0,"jsonrpc":"2.0","result":{"capabilities"
6 |
7 | {"jsonrpc":"2.0","id":3,"method":"shutdown"}
8 | # CHECK: {"id":3,"jsonrpc":"2.0","result":null}
9 |
10 | {"jsonrpc":"2.0","method":"exit"}
11 |
--------------------------------------------------------------------------------
/clangd/unittests/TestScheme.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clangd/unittests/lit.site.cfg.py.in:
--------------------------------------------------------------------------------
1 | @LIT_SITE_CFG_IN_HEADER@
2 | # This is a shim to run the gtest unittests in ../unittests using lit.
3 |
4 | config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
5 | config.shlibdir = "@SHLIBDIR@"
6 |
7 | config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.."
8 | config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.."
9 |
10 | # Delegate logic to lit.cfg.py.
11 | lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg.py")
12 |
--------------------------------------------------------------------------------
/clangd/unittests/xpc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | get_filename_component(CLANGD_SOURCE_DIR
6 | ${CMAKE_CURRENT_SOURCE_DIR}/../../clangd REALPATH)
7 | include_directories(
8 | ${CLANGD_SOURCE_DIR}
9 | )
10 |
11 | add_custom_target(ClangdXpcUnitTests)
12 | add_unittest(ClangdXpcUnitTests ClangdXpcTests
13 | ConversionTests.cpp
14 | )
15 |
16 | target_link_libraries(ClangdXpcTests
17 | PRIVATE
18 | clangdXpcJsonConversions
19 | clangDaemon
20 | LLVMSupport
21 | LLVMTestingSupport
22 | )
23 |
--------------------------------------------------------------------------------
/clangd/xpc/README.txt:
--------------------------------------------------------------------------------
1 | This directory contains:
2 | - the XPC transport layer (alternative transport layer to JSON-RPC)
3 | - XPC framework wrapper that wraps around Clangd to make it a valid XPC service
4 | - XPC test-client
5 |
6 | MacOS only. Feature is guarded by CLANGD_BUILD_XPC, including whole xpc/ dir.
--------------------------------------------------------------------------------
/clangd/xpc/framework/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | set(SOURCES
3 | ClangdXPC.cpp
4 | )
5 | add_clang_library(ClangdXPCLib SHARED
6 | ${SOURCES}
7 | DEPENDS
8 | clangd
9 | )
10 | create_clangd_xpc_framework(ClangdXPCLib "ClangdXPC")
11 |
--------------------------------------------------------------------------------
/clangd/xpc/framework/ClangdXPC.cpp:
--------------------------------------------------------------------------------
1 | //===-- ClangdXPC.cpp --------------------------------------------*- C++-*-===//
2 | //
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 | // See https://llvm.org/LICENSE.txt for license information.
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 | //
7 | //===----------------------------------------------------------------------===//
8 |
9 | /// Returns the bundle identifier of the Clangd XPC service.
10 | extern "C" const char *clangd_xpc_get_bundle_identifier() {
11 | return "org.llvm.clangd";
12 | }
13 |
--------------------------------------------------------------------------------
/clangd/xpc/test-client/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(
2 | ${CMAKE_CURRENT_SOURCE_DIR}/../../
3 | )
4 |
5 | add_clang_tool(
6 | clangd-xpc-test-client
7 | ClangdXPCTestClient.cpp
8 |
9 | DEPENDS ClangdXPC
10 | )
11 |
12 | set(LLVM_LINK_COMPONENTS
13 | support
14 | )
15 |
16 | target_link_libraries(clangd-xpc-test-client
17 | PRIVATE
18 | clangBasic
19 | clangDaemon
20 | clangFormat
21 | clangFrontend
22 | clangSema
23 | clangTooling
24 | clangToolingCore
25 | clangdXpcJsonConversions
26 | )
27 |
--------------------------------------------------------------------------------
/docs/README.txt:
--------------------------------------------------------------------------------
1 | ----------------------------------
2 | Documentation in clang-tools-extra
3 | ----------------------------------
4 |
5 | To generate documentation in HTML format from files in clang-tools-extra/docs,
6 | build the docs-clang-tools-html target.
7 |
8 | To generate documentation from the source code using Doxygen, build the
9 | doxygen-clang-tools target.
10 |
11 |
--------------------------------------------------------------------------------
/docs/_templates/layout.html:
--------------------------------------------------------------------------------
1 | {% extends "!layout.html" %}
2 |
3 | {% set css_files = css_files + ['_static/clang-tools-extra-styles.css'] %}
4 |
--------------------------------------------------------------------------------
/docs/clang-modernize.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | All :program:`clang-modernize` transforms have moved to :doc:`clang-tidy/index`
4 | (see the ``modernize`` module).
5 |
--------------------------------------------------------------------------------
/docs/clang-tidy.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. meta::
4 | :http-equiv=refresh: 0;URL='clang-tidy/'
5 |
6 | clang-tidy documentation has moved here: https://clang.llvm.org/extra/clang-tidy/
7 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/abseil-no-namespace.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - abseil-no-namespace
2 |
3 | abseil-no-namespace
4 | ===================
5 |
6 | Ensures code does not open ``namespace absl`` as that violates Abseil's
7 | compatibility guidelines. Code should not open ``namespace absl`` as that
8 | conflicts with Abseil's compatibility guidelines and may result in breakage.
9 |
10 | Any code that uses:
11 |
12 | .. code-block:: c++
13 |
14 | namespace absl {
15 | ...
16 | }
17 |
18 | will be prompted with a warning.
19 |
20 | See `the full Abseil compatibility guidelines `_ for more information.
22 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/abseil-str-cat-append.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - abseil-str-cat-append
2 |
3 | abseil-str-cat-append
4 | =====================
5 |
6 | Flags uses of ``absl::StrCat()`` to append to a ``std::string``. Suggests
7 | ``absl::StrAppend()`` should be used instead.
8 |
9 | The extra calls cause unnecessary temporary strings to be constructed. Removing
10 | them makes the code smaller and faster.
11 |
12 | .. code-block:: c++
13 |
14 | a = absl::StrCat(a, b); // Use absl::StrAppend(&a, b) instead.
15 |
16 | Does not diagnose cases where ``absl::StrCat()`` is used as a template
17 | argument for a functor.
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-accept.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-accept
2 |
3 | android-cloexec-accept
4 | ======================
5 |
6 | The usage of ``accept()`` is not recommended, it's better to use ``accept4()``.
7 | Without this flag, an opened sensitive file descriptor would remain open across
8 | a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | accept(sockfd, addr, addrlen);
15 |
16 | // becomes
17 |
18 | accept4(sockfd, addr, addrlen, SOCK_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-accept4.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-accept4
2 |
3 | android-cloexec-accept4
4 | =======================
5 |
6 | ``accept4()`` should include ``SOCK_CLOEXEC`` in its type argument to avoid the
7 | file descriptor leakage. Without this flag, an opened sensitive file would
8 | remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | accept4(sockfd, addr, addrlen, SOCK_NONBLOCK);
15 |
16 | // becomes
17 |
18 | accept4(sockfd, addr, addrlen, SOCK_NONBLOCK | SOCK_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-creat.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-creat
2 |
3 | android-cloexec-creat
4 | =====================
5 |
6 | The usage of ``creat()`` is not recommended, it's better to use ``open()``.
7 |
8 | Examples:
9 |
10 | .. code-block:: c++
11 |
12 | int fd = creat(path, mode);
13 |
14 | // becomes
15 |
16 | int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode);
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-dup.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-dup
2 |
3 | android-cloexec-dup
4 | ===================
5 |
6 | The usage of ``dup()`` is not recommended, it's better to use ``fcntl()``,
7 | which can set the close-on-exec flag. Otherwise, an opened sensitive file would
8 | remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | int fd = dup(oldfd);
15 |
16 | // becomes
17 |
18 | int fd = fcntl(oldfd, F_DUPFD_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-epoll-create.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-epoll-create
2 |
3 | android-cloexec-epoll-create
4 | ============================
5 |
6 | The usage of ``epoll_create()`` is not recommended, it's better to use
7 | ``epoll_create1()``, which allows close-on-exec.
8 |
9 | Examples:
10 |
11 | .. code-block:: c++
12 |
13 | epoll_create(size);
14 |
15 | // becomes
16 |
17 | epoll_create1(EPOLL_CLOEXEC);
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-epoll-create1.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-epoll-create1
2 |
3 | android-cloexec-epoll-create1
4 | =============================
5 |
6 | ``epoll_create1()`` should include ``EPOLL_CLOEXEC`` in its type argument to
7 | avoid the file descriptor leakage. Without this flag, an opened sensitive file
8 | would remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | epoll_create1(0);
15 |
16 | // becomes
17 |
18 | epoll_create1(EPOLL_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-fopen.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-fopen
2 |
3 | android-cloexec-fopen
4 | =====================
5 |
6 | ``fopen()`` should include ``e`` in their mode string; so ``re`` would be
7 | valid. This is equivalent to having set ``FD_CLOEXEC on`` that descriptor.
8 |
9 | Examples:
10 |
11 | .. code-block:: c++
12 |
13 | fopen("fn", "r");
14 |
15 | // becomes
16 |
17 | fopen("fn", "re");
18 |
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-inotify-init.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-inotify-init
2 |
3 | android-cloexec-inotify-init
4 | ============================
5 |
6 | The usage of ``inotify_init()`` is not recommended, it's better to use
7 | ``inotify_init1()``.
8 |
9 | Examples:
10 |
11 | .. code-block:: c++
12 |
13 | inotify_init();
14 |
15 | // becomes
16 |
17 | inotify_init1(IN_CLOEXEC);
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-inotify-init1.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-inotify-init1
2 |
3 | android-cloexec-inotify-init1
4 | =============================
5 |
6 | ``inotify_init1()`` should include ``IN_CLOEXEC`` in its type argument to avoid the
7 | file descriptor leakage. Without this flag, an opened sensitive file would
8 | remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | inotify_init1(IN_NONBLOCK);
15 |
16 | // becomes
17 |
18 | inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-memfd-create.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-memfd-create
2 |
3 | android-cloexec-memfd-create
4 | ============================
5 |
6 | ``memfd_create()`` should include ``MFD_CLOEXEC`` in its type argument to avoid
7 | the file descriptor leakage. Without this flag, an opened sensitive file would
8 | remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | memfd_create(name, MFD_ALLOW_SEALING);
15 |
16 | // becomes
17 |
18 | memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/android-cloexec-socket.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - android-cloexec-socket
2 |
3 | android-cloexec-socket
4 | ======================
5 |
6 | ``socket()`` should include ``SOCK_CLOEXEC`` in its type argument to avoid the
7 | file descriptor leakage. Without this flag, an opened sensitive file would
8 | remain open across a fork+exec to a lower-privileged SELinux domain.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | socket(domain, type, SOCK_STREAM);
15 |
16 | // becomes
17 |
18 | socket(domain, type, SOCK_STREAM | SOCK_CLOEXEC);
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-bool-pointer-implicit-conversion.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-bool-pointer-implicit-conversion
2 |
3 | bugprone-bool-pointer-implicit-conversion
4 | =========================================
5 |
6 | Checks for conditions based on implicit conversion from a ``bool`` pointer to
7 | ``bool``.
8 |
9 | Example:
10 |
11 | .. code-block:: c++
12 |
13 | bool *p;
14 | if (p) {
15 | // Never used in a pointer-specific way.
16 | }
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-incorrect-roundings.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-incorrect-roundings
2 |
3 | bugprone-incorrect-roundings
4 | ============================
5 |
6 | Checks the usage of patterns known to produce incorrect rounding.
7 | Programmers often use::
8 |
9 | (int)(double_expression + 0.5)
10 |
11 | to round the double expression to an integer. The problem with this:
12 |
13 | 1. It is unnecessarily slow.
14 | 2. It is incorrect. The number 0.499999975 (smallest representable float
15 | number below 0.5) rounds to 1.0. Even worse behavior for negative
16 | numbers where both -0.5f and -1.4f both round to 0.0.
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-macro-repeated-side-effects.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-macro-repeated-side-effects
2 |
3 | bugprone-macro-repeated-side-effects
4 | ====================================
5 |
6 |
7 | Checks for repeated argument with side effects in macros.
8 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-multiple-statement-macro.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-multiple-statement-macro
2 |
3 | bugprone-multiple-statement-macro
4 | =================================
5 |
6 | Detect multiple statement macros that are used in unbraced conditionals. Only
7 | the first statement of the macro will be inside the conditional and the other
8 | ones will be executed unconditionally.
9 |
10 | Example:
11 |
12 | .. code-block:: c++
13 |
14 | #define INCREMENT_TWO(x, y) (x)++; (y)++
15 | if (do_increment)
16 | INCREMENT_TWO(a, b); // (b)++ will be executed unconditionally.
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-swapped-arguments.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-swapped-arguments
2 |
3 | bugprone-swapped-arguments
4 | ==========================
5 |
6 | Finds potentially swapped arguments by looking at implicit conversions.
7 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-terminating-continue.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-terminating-continue
2 |
3 | bugprone-terminating-continue
4 | =============================
5 |
6 | Detects `do while` loops with a condition always evaluating to false that
7 | have a `continue` statement, as this `continue` terminates the loop
8 | effectively.
9 |
10 | .. code-block:: c++
11 |
12 | void f() {
13 | do {
14 | // some code
15 | continue; // terminating continue
16 | // some other code
17 | } while(false);
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-undefined-memory-manipulation.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-undefined-memory-manipulation
2 |
3 | bugprone-undefined-memory-manipulation
4 | ======================================
5 |
6 | Finds calls of memory manipulation functions ``memset()``, ``memcpy()`` and
7 | ``memmove()`` on not TriviallyCopyable objects resulting in undefined behavior.
8 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-undelegated-constructor.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-undelegated-constructor
2 |
3 | bugprone-undelegated-constructor
4 | ================================
5 |
6 | Finds creation of temporary objects in constructors that look like a
7 | function call to another constructor of the same class.
8 |
9 | The user most likely meant to use a delegating constructor or base class
10 | initializer.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - bugprone-virtual-near-miss
2 |
3 | bugprone-virtual-near-miss
4 | ==========================
5 |
6 | Warn if a function is a near miss (ie. the name is very similar and the function
7 | signiture is the same) to a virtual function from a base class.
8 |
9 | Example:
10 |
11 | .. code-block:: c++
12 |
13 | struct Base {
14 | virtual void func();
15 | };
16 |
17 | struct Derived : Base {
18 | virtual funk();
19 | // warning: 'Derived::funk' has a similar name and the same signature as virtual method 'Base::func'; did you mean to override it?
20 | };
21 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl03-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl03-c
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-static-assert.html
4 |
5 | cert-dcl03-c
6 | ============
7 |
8 | The cert-dcl03-c check is an alias, please see
9 | `misc-static-assert `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl16-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl16-c
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-uppercase-literal-suffix.html
4 |
5 | cert-dcl16-c
6 | ============
7 |
8 | The cert-dcl16-c check is an alias, please see
9 | `readability-uppercase-literal-suffix `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl21-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl21-cpp
2 |
3 | cert-dcl21-cpp
4 | ==============
5 |
6 | This check flags postfix ``operator++`` and ``operator--`` declarations
7 | if the return type is not a const object. This also warns if the return type
8 | is a reference type.
9 |
10 | This check corresponds to the CERT C++ Coding Standard recommendation
11 | `DCL21-CPP. Overloaded postfix increment and decrement operators should return a const object
12 | `_.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl50-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl50-cpp
2 |
3 | cert-dcl50-cpp
4 | ==============
5 |
6 | This check flags all function definitions (but not declarations) of C-style
7 | variadic functions.
8 |
9 | This check corresponds to the CERT C++ Coding Standard rule
10 | `DCL50-CPP. Do not define a C-style variadic function
11 | `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl54-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl54-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-new-delete-overloads.html
4 |
5 | cert-dcl54-cpp
6 | ==============
7 |
8 | The cert-dcl54-cpp check is an alias, please see
9 | `misc-new-delete-overloads `_ for more
10 | information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl58-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl58-cpp
2 |
3 | cert-dcl58-cpp
4 | ==============
5 |
6 | Modification of the ``std`` or ``posix`` namespace can result in undefined
7 | behavior.
8 | This check warns for such modifications.
9 |
10 | Examples:
11 |
12 | .. code-block:: c++
13 |
14 | namespace std {
15 | int x; // May cause undefined behavior.
16 | }
17 |
18 |
19 | This check corresponds to the CERT C++ Coding Standard rule
20 | `DCL58-CPP. Do not modify the standard namespaces
21 | `_.
22 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-dcl59-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-dcl59-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=google-build-namespaces.html
4 |
5 | cert-dcl59-cpp
6 | ==============
7 |
8 | The cert-dcl59-cpp check is an alias, please see
9 | `google-build-namespaces `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-env33-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-env33-c
2 |
3 | cert-env33-c
4 | ============
5 |
6 | This check flags calls to ``system()``, ``popen()``, and ``_popen()``, which
7 | execute a command processor. It does not flag calls to ``system()`` with a null
8 | pointer argument, as such a call checks for the presence of a command processor
9 | but does not actually attempt to execute a command.
10 |
11 | This check corresponds to the CERT C Coding Standard rule
12 | `ENV33-C. Do not call system()
13 | `_.
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-err09-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-err09-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-throw-by-value-catch-by-reference.html
4 |
5 | cert-err09-cpp
6 | ==============
7 |
8 | The cert-err09-cpp check is an alias, please see
9 | `misc-throw-by-value-catch-by-reference `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-err52-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-err52-cpp
2 |
3 | cert-err52-cpp
4 | ==============
5 |
6 | This check flags all call expressions involving ``setjmp()`` and ``longjmp()``.
7 |
8 | This check corresponds to the CERT C++ Coding Standard rule
9 | `ERR52-CPP. Do not use setjmp() or longjmp()
10 | `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-err58-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-err58-cpp
2 |
3 | cert-err58-cpp
4 | ==============
5 |
6 | This check flags all ``static`` or ``thread_local`` variable declarations where
7 | the initializer for the object may throw an exception.
8 |
9 | This check corresponds to the CERT C++ Coding Standard rule
10 | `ERR58-CPP. Handle all exceptions thrown before main() begins executing
11 | `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-err60-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-err60-cpp
2 |
3 | cert-err60-cpp
4 | ==============
5 |
6 | This check flags all throw expressions where the exception object is not nothrow
7 | copy constructible.
8 |
9 | This check corresponds to the CERT C++ Coding Standard rule
10 | `ERR60-CPP. Exception objects must be nothrow copy constructible
11 | `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-err61-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-err61-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-throw-by-value-catch-by-reference.html
4 |
5 | cert-err61-cpp
6 | ==============
7 |
8 | The cert-err61-cpp check is an alias, please see
9 | `misc-throw-by-value-catch-by-reference `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-fio38-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-fio38-c
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-non-copyable-objects.html
4 |
5 | cert-fio38-c
6 | ============
7 |
8 | The cert-fio38-c check is an alias, please see
9 | `misc-non-copyable-objects `_ for more
10 | information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-flp30-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-flp30-c
2 |
3 | cert-flp30-c
4 | ============
5 |
6 | This check flags ``for`` loops where the induction expression has a
7 | floating-point type.
8 |
9 | This check corresponds to the CERT C Coding Standard rule
10 | `FLP30-C. Do not use floating-point variables as loop counters
11 | `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-msc30-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-msc30-c
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cert-msc50-cpp.html
4 |
5 | cert-msc30-c
6 | ============
7 |
8 | The cert-msc30-c check is an alias, please see
9 | `cert-msc50-cpp `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-msc32-c.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-msc32-c
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cert-msc51-cpp.html
4 |
5 | cert-msc32-c
6 | ============
7 |
8 | The cert-msc32-c check is an alias, please see
9 | `cert-msc51-cpp `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-msc50-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-msc50-cpp
2 |
3 | cert-msc50-cpp
4 | ==============
5 |
6 | Pseudorandom number generators use mathematical algorithms to produce a sequence
7 | of numbers with good statistical properties, but the numbers produced are not
8 | genuinely random. The ``std::rand()`` function takes a seed (number), runs a
9 | mathematical operation on it and returns the result. By manipulating the seed
10 | the result can be predictable. This check warns for the usage of
11 | ``std::rand()``.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-oop11-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-oop11-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=performance-move-constructor-init.html
4 |
5 | cert-oop11-cpp
6 | ==============
7 |
8 | The cert-oop11-cpp check is an alias, please see
9 | `performance-move-constructor-init `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cert-oop54-cpp.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cert-oop54-cpp
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=bugprone-unhandled-self-assignment.html
4 |
5 | cert-oop54-cpp
6 | ==============
7 |
8 | The cert-oop54-cpp check is an alias, please see
9 | `bugprone-unhandled-self-assignment `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-avoid-c-arrays.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-avoid-c-arrays
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-avoid-c-arrays.html
4 |
5 | cppcoreguidelines-avoid-c-arrays
6 | ================================
7 |
8 | The cppcoreguidelines-avoid-c-arrays check is an alias, please see
9 | `modernize-avoid-c-arrays `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-avoid-magic-numbers.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-avoid-magic-numbers
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-magic-numbers.html
4 |
5 | cppcoreguidelines-avoid-magic-numbers
6 | =====================================
7 |
8 | The cppcoreguidelines-avoid-magic-numbers check is an alias, please see
9 | `readability-magic-numbers `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-c-copy-assignment-signature.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-c-copy-assignment-signature
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-unconventional-assign-operator.html
4 |
5 | cppcoreguidelines-c-copy-assignment-signature
6 | =============================================
7 |
8 | The cppcoreguidelines-c-copy-assignment-signature check is an alias, please see
9 | `misc-unconventional-assign-operator `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-explicit-virtual-functions.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-explicit-virtual-functions
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-override.html
4 |
5 | cppcoreguidelines-explicit-virtual-functions
6 | ============================================
7 |
8 | The cppcoreguidelines-explicit-virtual-functions check is an alias, please see
9 | `modernize-use-override `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-non-private-member-variables-in-classes.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-non-private-member-variables-in-classes
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-non-private-member-variables-in-classes.html
4 |
5 | cppcoreguidelines-non-private-member-variables-in-classes
6 | =========================================================
7 |
8 | The cppcoreguidelines-non-private-member-variables-in-classes check is an alias,
9 | please see
10 | `misc-non-private-member-variables-in-classes `_
11 | for more information.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-array-to-pointer-decay.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-pro-bounds-array-to-pointer-decay
2 |
3 | cppcoreguidelines-pro-bounds-array-to-pointer-decay
4 | ===================================================
5 |
6 | This check flags all array to pointer decays.
7 |
8 | Pointers should not be used as arrays. ``span`` is a bounds-checked, safe
9 | alternative to using pointers to access arrays.
10 |
11 | This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see
12 | https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-decay.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/cppcoreguidelines-pro-type-const-cast.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - cppcoreguidelines-pro-type-const-cast
2 |
3 | cppcoreguidelines-pro-type-const-cast
4 | =====================================
5 |
6 | This check flags all uses of ``const_cast`` in C++ code.
7 |
8 | Modifying a variable that was declared const is undefined behavior, even with
9 | ``const_cast``.
10 |
11 | This rule is part of the "Type safety" profile of the C++ Core Guidelines, see
12 | https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-type-constcast.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/fuchsia-default-arguments-declarations.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - fuchsia-default-arguments-declarations
2 |
3 | fuchsia-default-arguments-declarations
4 | ======================================
5 |
6 | Warns if a function or method is declared with default parameters.
7 |
8 | For example, the declaration:
9 |
10 | .. code-block:: c++
11 |
12 | int foo(int value = 5) { return value; }
13 |
14 | will cause a warning.
15 |
16 | See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/fuchsia-header-anon-namespaces.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - fuchsia-header-anon-namespaces
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=google-build-namespaces.html
4 |
5 | fuchsia-header-anon-namespaces
6 | ==============================
7 |
8 | The fuchsia-header-anon-namespaces check is an alias, please see
9 | `google-build-namespace `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/fuchsia-overloaded-operator.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - fuchsia-overloaded-operator
2 |
3 | fuchsia-overloaded-operator
4 | ===========================
5 |
6 | Warns if an operator is overloaded, except for the assignment (copy and move)
7 | operators.
8 |
9 | For example:
10 |
11 | .. code-block:: c++
12 |
13 | int operator+(int); // Warning
14 |
15 | B &operator=(const B &Other); // No warning
16 | B &operator=(B &&Other) // No warning
17 |
18 | See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/fuchsia-virtual-inheritance.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - fuchsia-virtual-inheritance
2 |
3 | fuchsia-virtual-inheritance
4 | ===========================
5 |
6 | Warns if classes are defined with virtual inheritance.
7 |
8 | For example, classes should not be defined with virtual inheritance:
9 |
10 | .. code-block:: c++
11 |
12 | class B : public virtual A {}; // warning
13 |
14 | See the features disallowed in Fuchsia at https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
15 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-build-explicit-make-pair.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-build-explicit-make-pair
2 |
3 | google-build-explicit-make-pair
4 | ===============================
5 |
6 | Check that ``make_pair``'s template arguments are deduced.
7 |
8 | G++ 4.6 in C++11 mode fails badly if ``make_pair``'s template arguments are
9 | specified explicitly, and such use isn't intended in any case.
10 |
11 | Corresponding cpplint.py check name: `build/explicit_make_pair`.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-default-arguments.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-default-arguments
2 |
3 | google-default-arguments
4 | ========================
5 |
6 | Checks that default arguments are not given for virtual methods.
7 |
8 | See https://google.github.io/styleguide/cppguide.html#Default_Arguments
9 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-readability-braces-around-statements.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-readability-braces-around-statements
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-braces-around-statements.html
4 |
5 | google-readability-braces-around-statements
6 | ===========================================
7 |
8 | The google-readability-braces-around-statements check is an alias, please see
9 | `readability-braces-around-statements `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-readability-casting.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-readability-casting
2 |
3 | google-readability-casting
4 | ==========================
5 |
6 | Finds usages of C-style casts.
7 |
8 | https://google.github.io/styleguide/cppguide.html#Casting
9 |
10 | Corresponding cpplint.py check name: `readability/casting`.
11 |
12 | This check is similar to `-Wold-style-cast`, but it suggests automated fixes
13 | in some cases. The reported locations should not be different from the
14 | ones generated by `-Wold-style-cast`.
15 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-readability-function-size.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-readability-function-size
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-function-size.html
4 |
5 | google-readability-function-size
6 | ================================
7 |
8 | The google-readability-function-size check is an alias, please see
9 | `readability-function-size `_ for more
10 | information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-readability-namespace-comments.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-readability-namespace-comments
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=llvm-namespace-comment.html
4 |
5 | google-readability-namespace-comments
6 | =====================================
7 |
8 | The google-readability-namespace-comments check is an alias, please see
9 | `llvm-namespace-comment `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-readability-todo.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-readability-todo
2 |
3 | google-readability-todo
4 | =======================
5 |
6 | Finds TODO comments without a username or bug number.
7 |
8 | The relevant style guide section is
9 | https://google.github.io/styleguide/cppguide.html#TODO_Comments.
10 |
11 | Corresponding cpplint.py check: `readability/todo`
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-runtime-operator.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-runtime-operator
2 |
3 | google-runtime-operator
4 | =======================
5 |
6 | Finds overloads of unary ``operator &``.
7 |
8 | https://google.github.io/styleguide/cppguide.html#Operator_Overloading
9 |
10 | Corresponding cpplint.py check name: `runtime/operator`.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/google-runtime-references.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - google-runtime-references
2 |
3 | google-runtime-references
4 | =========================
5 |
6 | Checks the usage of non-constant references in function parameters.
7 |
8 | The corresponding style guide rule:
9 | https://google.github.io/styleguide/cppguide.html#Reference_Arguments
10 |
11 |
12 | Options
13 | -------
14 |
15 | .. option:: WhiteListTypes
16 |
17 | A semicolon-separated list of names of whitelist types. Default is empty.
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-avoid-c-arrays.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-avoid-c-arrays
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-avoid-c-arrays.html
4 |
5 | hicpp-avoid-c-arrays
6 | ====================
7 |
8 | The hicpp-avoid-c-arrays check is an alias, please see
9 | `modernize-avoid-c-arrays `_
10 | for more information.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-avoid-goto.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-avoid-goto
2 |
3 | hicpp-avoid-goto
4 | ================
5 |
6 | The `hicpp-avoid-goto` check is an alias to
7 | `cppcoreguidelines-avoid-goto `_.
8 | Rule `6.3.1 High Integrity C++ `_
9 | requires that ``goto`` only skips parts of a block and is not used for other
10 | reasons.
11 |
12 | Both coding guidelines implement the same exception to the usage of ``goto``.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-braces-around-statements.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-braces-around-statements
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-braces-around-statements.html
4 |
5 | hicpp-braces-around-statements
6 | ==============================
7 |
8 | The `hicpp-braces-around-statements` check is an alias, please see
9 | `readability-braces-around-statements `_
10 | for more information.
11 | It enforces the `rule 6.1.1 `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-deprecated-headers.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-deprecated-headers
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-deprecated-headers.html
4 |
5 | hicpp-deprecated-headers
6 | ========================
7 |
8 | The `hicpp-deprecated-headers` check is an alias, please see
9 | `modernize-deprecated-headers `_
10 | for more information.
11 | It enforces the `rule 1.3.3 `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-invalid-access-moved.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-invalid-access-moved
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=bugprone-use-after-move.html
4 |
5 | hicpp-invalid-access-moved
6 | ==========================
7 |
8 | This check is an alias for `bugprone-use-after-move `_.
9 |
10 | Implements parts of the `rule 8.4.1 `_ to check if moved-from objects are accessed.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-member-init.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-member-init
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cppcoreguidelines-pro-type-member-init.html
4 |
5 | hicpp-member-init
6 | =================
7 |
8 | This check is an alias for `cppcoreguidelines-pro-type-member-init `_.
9 | Implements the check for
10 | `rule 12.4.2 `_
11 | to initialize class members in the right order.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-move-const-arg.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-move-const-arg
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=performance-move-const-arg.html
4 |
5 | hicpp-move-const-arg
6 | ====================
7 |
8 | The `hicpp-move-const-arg` check is an alias, please see
9 | `performance-move-const-arg `_ for more information.
10 | It enforces the `rule 17.3.1 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-named-parameter.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-named-parameter
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-named-parameter.html
4 |
5 | hicpp-named-parameter
6 | =====================
7 |
8 | This check is an alias for `readability-named-parameter `_.
9 |
10 | Implements `rule 8.2.1 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-new-delete-operators.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-new-delete-operators
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-new-delete-overloads.html
4 |
5 | hicpp-new-delete-operators
6 | ==========================
7 |
8 | This check is an alias for `misc-new-delete-overloads `_.
9 | Implements `rule 12.3.1 `_ to ensure
10 | the `new` and `delete` operators have the correct signature.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-no-array-decay.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-no-array-decay
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cppcoreguidelines-pro-bounds-array-to-pointer-decay.html
4 |
5 | hicpp-no-array-decay
6 | ====================
7 |
8 | The `hicpp-no-array-decay` check is an alias, please see
9 | `cppcoreguidelines-pro-bounds-array-to-pointer-decay `_
10 | for more information.
11 | It enforces the `rule 4.1.1 `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-no-assembler.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-no-assembler
2 |
3 | hicpp-no-assembler
4 | ===================
5 |
6 | Check for assembler statements. No fix is offered.
7 |
8 | Inline assembler is forbidden by the `High Intergrity C++ Coding Standard
9 | `_
10 | as it restricts the portability of code.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-no-malloc.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-no-malloc
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cppcoreguidelines-no-malloc.html
4 |
5 | hicpp-no-malloc
6 | ===============
7 |
8 | The `hicpp-no-malloc` check is an alias, please see
9 | `cppcoreguidelines-no-malloc `_
10 | for more information.
11 | It enforces the `rule 5.3.2 `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-noexcept-move.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-noexcept-move
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-noexcept-moveconstructor.html
4 |
5 | hicpp-noexcept-move
6 | ===================
7 |
8 | This check is an alias for `misc-noexcept-moveconstructor `_.
9 | Checks `rule 12.5.4 `_ to mark move assignment and move construction `noexcept`.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-signed-bitwise.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-signed-bitwise
2 |
3 | hicpp-signed-bitwise
4 | ====================
5 |
6 | Finds uses of bitwise operations on signed integer types, which may lead to
7 | undefined or implementation defined behaviour.
8 |
9 | The according rule is defined in the `High Integrity C++ Standard, Section 5.6.1 `_.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-special-member-functions.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-special-member-functions
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cppcoreguidelines-special-member-functions.html
4 |
5 | hicpp-special-member-functions
6 | ==============================
7 |
8 | This check is an alias for `cppcoreguidelines-special-member-functions `_.
9 | Checks that special member functions have the correct signature, according to `rule 12.5.7 `_.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-static-assert.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-static-assert
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=misc-static-assert.html
4 |
5 | hicpp-static-assert
6 | ===================
7 |
8 | The `hicpp-static-assert` check is an alias, please see
9 | `misc-static-assert `_ for more information.
10 | It enforces the `rule 7.1.10 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-uppercase-literal-suffix.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-uppercase-literal-suffix
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=readability-uppercase-literal-suffix.html
4 |
5 | hicpp-uppercase-literal-suffix
6 | ==============================
7 |
8 | The hicpp-uppercase-literal-suffix check is an alias, please see
9 | `readability-uppercase-literal-suffix `_ for more information.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-auto.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-auto
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-auto.html
4 |
5 | hicpp-use-auto
6 | ==============
7 |
8 | The `hicpp-use-auto` check is an alias, please see
9 | `modernize-use-auto `_ for more information.
10 | It enforces the `rule 7.1.8 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-emplace.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-emplace
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-emplace.html
4 |
5 | hicpp-use-emplace
6 | =================
7 |
8 | The `hicpp-use-emplace` check is an alias, please see
9 | `modernize-use-emplace `_ for more information.
10 | It enforces the `rule 17.4.2 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-equals-default.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-equals-defaults
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-equals-default.html
4 |
5 | hicpp-use-equals-default
6 | ========================
7 |
8 | This check is an alias for `modernize-use-equals-default `_.
9 | Implements `rule 12.5.1 `_ to explicitly default special member functions.
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-equals-delete.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-equals-delete
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-equals-delete.html
4 |
5 | hicpp-use-equals-delete
6 | =======================
7 |
8 | This check is an alias for `modernize-use-equals-delete `_.
9 | Implements `rule 12.5.1 `_
10 | to explicitly default or delete special member functions.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-noexcept.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-noexcept
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-noexcept.html
4 |
5 | hicpp-use-noexcept
6 | ==================
7 |
8 | The `hicpp-use-noexcept` check is an alias, please see
9 | `modernize-use-noexcept `_ for more information.
10 | It enforces the `rule 1.3.5 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-nullptr.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-nullptr
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-nullptr.html
4 |
5 | hicpp-use-nullptr
6 | =================
7 |
8 | The `hicpp-use-nullptr` check is an alias, please see
9 | `modernize-use-nullptr `_ for more information.
10 | It enforces the `rule 2.5.3 `_.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-use-override.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-use-override
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=modernize-use-override.html
4 |
5 | hicpp-use-override
6 | ==================
7 |
8 | This check is an alias for `modernize-use-override `_.
9 | Implements `rule 10.2.1 `_ to
10 | declare a virtual function `override` when overriding.
11 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/hicpp-vararg.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - hicpp-vararg
2 | .. meta::
3 | :http-equiv=refresh: 5;URL=cppcoreguidelines-pro-type-vararg.html
4 |
5 | hicpp-vararg
6 | ============
7 |
8 | The `hicpp-vararg` check is an alias, please see
9 | `cppcoreguidelines-pro-type-vararg `_
10 | for more information.
11 | It enforces the `rule 14.1.1 `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/llvm-header-guard.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - llvm-header-guard
2 |
3 | llvm-header-guard
4 | =================
5 |
6 | Finds and fixes header guards that do not adhere to LLVM style.
7 |
8 | Options
9 | -------
10 |
11 | .. option:: HeaderFileExtensions
12 |
13 | A comma-separated list of filename extensions of header files (the filename
14 | extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
15 | For header files without an extension, use an empty string (if there are no
16 | other desired extensions) or leave an empty element in the list. e.g.,
17 | "h,hh,hpp,hxx," (note the trailing comma).
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/llvm-include-order.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - llvm-include-order
2 |
3 | llvm-include-order
4 | ==================
5 |
6 |
7 | Checks the correct order of ``#includes``.
8 |
9 | See https://llvm.org/docs/CodingStandards.html#include-style
10 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/llvm-twine-local.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - llvm-twine-local
2 |
3 | llvm-twine-local
4 | ================
5 |
6 |
7 | Looks for local ``Twine`` variables which are prone to use after frees and
8 | should be generally avoided.
9 |
10 | .. code-block:: c++
11 |
12 | static Twine Moo = Twine("bark") + "bah";
13 |
14 | // becomes
15 |
16 | static std::string Moo = (Twine("bark") + "bah").str();
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-non-copyable-objects.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-non-copyable-objects
2 |
3 | misc-non-copyable-objects
4 | =========================
5 |
6 | `cert-fio38-c` redirects here as an alias for this check.
7 |
8 | The check flags dereferences and non-pointer declarations of objects that are
9 | not meant to be passed by value, such as C FILE objects or POSIX
10 | ``pthread_mutex_t`` objects.
11 |
12 | This check corresponds to CERT C++ Coding Standard rule `FIO38-C. Do not copy a FILE object
13 | `_.
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-static-assert.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-static-assert
2 |
3 | misc-static-assert
4 | ==================
5 |
6 | `cert-dcl03-c` redirects here as an alias for this check.
7 |
8 | Replaces ``assert()`` with ``static_assert()`` if the condition is evaluatable
9 | at compile time.
10 |
11 | The condition of ``static_assert()`` is evaluated at compile time which is
12 | safer and more efficient.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-unconventional-assign-operator.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-unconventional-assign-operator
2 |
3 | misc-unconventional-assign-operator
4 | ===================================
5 |
6 |
7 | Finds declarations of assign operators with the wrong return and/or argument
8 | types and definitions with good return type but wrong ``return`` statements.
9 |
10 | * The return type must be ``Class&``.
11 | * Works with move-assign and assign by value.
12 | * Private and deleted operators are ignored.
13 | * The operator must always return ``*this``.
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-uniqueptr-reset-release.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-uniqueptr-reset-release
2 |
3 | misc-uniqueptr-reset-release
4 | ============================
5 |
6 | Find and replace ``unique_ptr::reset(release())`` with ``std::move()``.
7 |
8 | Example:
9 |
10 | .. code-block:: c++
11 |
12 | std::unique_ptr x, y;
13 | x.reset(y.release()); -> x = std::move(y);
14 |
15 | If ``y`` is already rvalue, ``std::move()`` is not added. ``x`` and ``y`` can
16 | also be ``std::unique_ptr*``.
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-unused-alias-decls.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-unused-alias-decls
2 |
3 | misc-unused-alias-decls
4 | =======================
5 |
6 |
7 | Finds unused namespace alias declarations.
8 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/misc-unused-using-decls.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - misc-unused-using-decls
2 |
3 | misc-unused-using-decls
4 | =======================
5 |
6 | Finds unused ``using`` declarations.
7 |
8 | Example:
9 |
10 | .. code-block:: c++
11 |
12 | namespace n { class C; }
13 | using n::C; // Never actually used.
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/modernize-return-braced-init-list.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - modernize-return-braced-init-list
2 |
3 | modernize-return-braced-init-list
4 | =================================
5 |
6 | Replaces explicit calls to the constructor in a return with a braced
7 | initializer list. This way the return type is not needlessly duplicated in the
8 | function definition and the return statement.
9 |
10 | .. code:: c++
11 |
12 | Foo bar() {
13 | Baz baz;
14 | return Foo(baz);
15 | }
16 |
17 | // transforms to:
18 |
19 | Foo bar() {
20 | Baz baz;
21 | return {baz};
22 | }
23 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/modernize-shrink-to-fit.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - modernize-shrink-to-fit
2 |
3 | modernize-shrink-to-fit
4 | =======================
5 |
6 |
7 | Replace copy and swap tricks on shrinkable containers with the
8 | ``shrink_to_fit()`` method call.
9 |
10 | The ``shrink_to_fit()`` method is more readable and more effective than
11 | the copy and swap trick to reduce the capacity of a shrinkable container.
12 | Note that, the ``shrink_to_fit()`` method is only available in C++11 and up.
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/modernize-use-default.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. title:: clang-tidy - modernize-use-default
4 | .. meta::
5 | :http-equiv=refresh: 5;URL=modernize-use-equals-default.html
6 |
7 | modernize-use-default
8 | =====================
9 |
10 | This check has been renamed to
11 | `modernize-use-equals-default `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/objc-avoid-spinlock.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - objc-avoid-spinlock
2 |
3 | objc-avoid-spinlock
4 | ===================
5 |
6 | Finds usages of ``OSSpinlock``, which is deprecated due to potential livelock
7 | problems.
8 |
9 | This check will detect following function invocations:
10 |
11 | - ``OSSpinlockLock``
12 | - ``OSSpinlockTry``
13 | - ``OSSpinlockUnlock``
14 |
15 | The corresponding information about the problem of ``OSSpinlock``: https://blog.postmates.com/why-spinlocks-are-bad-on-ios-b69fc5221058
16 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/objc-super-self.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - objc-super-self
2 |
3 | objc-super-self
4 | ===============
5 |
6 | Finds invocations of ``-self`` on super instances in initializers of subclasses
7 | of ``NSObject`` and recommends calling a superclass initializer instead.
8 |
9 | Invoking ``-self`` on super instances in initializers is a common programmer
10 | error when the programmer's original intent is to call a superclass
11 | initializer. Failing to call a superclass initializer breaks initializer
12 | chaining and can result in invalid object initialization.
13 |
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. title:: clang-tidy - performance-implicit-cast-in-loop
4 | .. meta::
5 | :http-equiv=refresh: 5;URL=performance-implicit-conversion-in-loop.html
6 |
7 | performance-implicit-cast-in-loop
8 | =================================
9 |
10 | This check has been renamed to `performance-implicit-conversion-in-loop
11 | `_.
12 |
13 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/performance-move-constructor-init.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - performance-move-constructor-init
2 |
3 | performance-move-constructor-init
4 | =================================
5 |
6 | "cert-oop11-cpp" redirects here as an alias for this check.
7 |
8 | The check flags user-defined move constructors that have a ctor-initializer
9 | initializing a member or base class through a copy constructor instead of a
10 | move constructor.
11 |
12 | Options
13 | -------
14 |
15 | .. option:: IncludeStyle
16 |
17 | A string specifying which include-style is used, `llvm` or `google`. Default
18 | is `llvm`.
19 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-avoid-const-params-in-decls.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-avoid-const-params-in-decls
2 |
3 | readability-avoid-const-params-in-decls
4 | =======================================
5 |
6 | Checks whether a function declaration has parameters that are top level
7 | ``const``.
8 |
9 | ``const`` values in declarations do not affect the signature of a function, so
10 | they should not be put there.
11 |
12 | Examples:
13 |
14 | .. code-block:: c++
15 |
16 | void f(const string); // Bad: const is top level.
17 | void f(const string&); // Good: const is not top level.
18 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-delete-null-pointer.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-delete-null-pointer
2 |
3 | readability-delete-null-pointer
4 | ===============================
5 |
6 | Checks the ``if`` statements where a pointer's existence is checked and then deletes the pointer.
7 | The check is unnecessary as deleting a null pointer has no effect.
8 |
9 | .. code:: c++
10 |
11 | int *p;
12 | if (p)
13 | delete p;
14 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-implicit-bool-cast.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. title:: clang-tidy - readability-implicit-bool-cast
4 | .. meta::
5 | :http-equiv=refresh: 5;URL=readability-implicit-bool-conversion.html
6 |
7 | readability-implicit-bool-cast
8 | ==============================
9 |
10 | This check has been renamed to `readability-implicit-bool-conversion
11 | `_.
12 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-named-parameter.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-named-parameter
2 |
3 | readability-named-parameter
4 | ===========================
5 |
6 | Find functions with unnamed arguments.
7 |
8 | The check implements the following rule originating in the Google C++ Style
9 | Guide:
10 |
11 | https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
12 |
13 | All parameters should be named, with identical names in the declaration and
14 | implementation.
15 |
16 | Corresponding cpplint.py check name: `readability/function`.
17 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-redundant-function-ptr-dereference.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-redundant-function-ptr-dereference
2 |
3 | readability-redundant-function-ptr-dereference
4 | ==============================================
5 |
6 | Finds redundant dereferences of a function pointer.
7 |
8 | Before:
9 |
10 | .. code-block:: c++
11 |
12 | int f(int,int);
13 | int (*p)(int, int) = &f;
14 |
15 | int i = (**p)(10, 50);
16 |
17 | After:
18 |
19 | .. code-block:: c++
20 |
21 | int f(int,int);
22 | int (*p)(int, int) = &f;
23 |
24 | int i = (*p)(10, 50);
25 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-redundant-member-init.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-redundant-member-init
2 |
3 | readability-redundant-member-init
4 | =================================
5 |
6 | Finds member initializations that are unnecessary because the same default
7 | constructor would be called if they were not present.
8 |
9 | Example:
10 |
11 | .. code-block:: c++
12 |
13 | // Explicitly initializing the member s is unnecessary.
14 | class Foo {
15 | public:
16 | Foo() : s() {}
17 |
18 | private:
19 | std::string s;
20 | };
21 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-redundant-string-cstr.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-redundant-string-cstr
2 |
3 | readability-redundant-string-cstr
4 | =================================
5 |
6 |
7 | Finds unnecessary calls to ``std::string::c_str()`` and ``std::string::data()``.
8 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-redundant-string-init.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-redundant-string-init
2 |
3 | readability-redundant-string-init
4 | =================================
5 |
6 | Finds unnecessary string initializations.
7 |
8 | Examples:
9 |
10 | .. code-block:: c++
11 |
12 | // Initializing string with empty string literal is unnecessary.
13 | std::string a = "";
14 | std::string b("");
15 |
16 | // becomes
17 |
18 | std::string a;
19 | std::string b;
20 |
--------------------------------------------------------------------------------
/docs/clang-tidy/checks/readability-uniqueptr-delete-release.rst:
--------------------------------------------------------------------------------
1 | .. title:: clang-tidy - readability-uniqueptr-delete-release
2 |
3 | readability-uniqueptr-delete-release
4 | ====================================
5 |
6 | Replace ``delete .release()`` with `` = nullptr``.
7 | The latter is shorter, simpler and does not require use of raw pointer APIs.
8 |
9 | .. code-block:: c++
10 |
11 | std::unique_ptr P;
12 | delete P.release();
13 |
14 | // becomes
15 |
16 | std::unique_ptr P;
17 | P = nullptr;
18 |
--------------------------------------------------------------------------------
/docs/clangd.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | .. meta::
4 | :http-equiv=refresh: 0;URL='clangd/'
5 |
6 | All :program:`clangd` documentation was moved to the :doc:`clangd/index` pages.
7 |
--------------------------------------------------------------------------------
/docs/clangd/ApplyClangTidyFixInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/ApplyClangTidyFixInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/ApplyFixInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/ApplyFixInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/CodeCompletionInEmacsCompanyMode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/CodeCompletionInEmacsCompanyMode.png
--------------------------------------------------------------------------------
/docs/clangd/CodeCompletionInSublimeText.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/CodeCompletionInSublimeText.png
--------------------------------------------------------------------------------
/docs/clangd/CodeCompletionInVSCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/CodeCompletionInVSCode.png
--------------------------------------------------------------------------------
/docs/clangd/CodeCompletionInYCM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/CodeCompletionInYCM.png
--------------------------------------------------------------------------------
/docs/clangd/CodeCompletionInsertsNamespaceQualifiersInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/CodeCompletionInsertsNamespaceQualifiersInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/DiagnosticsInEmacsEglot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/DiagnosticsInEmacsEglot.png
--------------------------------------------------------------------------------
/docs/clangd/ErrorsInVSCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/ErrorsInVSCode.png
--------------------------------------------------------------------------------
/docs/clangd/FindAllReferencesInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/FindAllReferencesInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/FormatSelectionInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/FormatSelectionInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/GoToDefinitionInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/GoToDefinitionInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/NavigationWithBreadcrumbsInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/NavigationWithBreadcrumbsInVSCode.gif
--------------------------------------------------------------------------------
/docs/clangd/OutlineInVSCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/OutlineInVSCode.png
--------------------------------------------------------------------------------
/docs/clangd/SignatureHelpInVSCode.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apple/swift-clang-tools-extra/HEAD/docs/clangd/SignatureHelpInVSCode.gif
--------------------------------------------------------------------------------
/docs/cpp11-migrate.rst:
--------------------------------------------------------------------------------
1 | :orphan:
2 |
3 | All :program:`clang-modernize` transforms have moved to :doc:`clang-tidy/index`
4 | (see the ``modernize`` module).
5 |
--------------------------------------------------------------------------------
/docs/doxygen-mainpage.dox:
--------------------------------------------------------------------------------
1 | /// \mainpage clang-tools
2 | ///
3 | /// \section main_intro Introduction
4 | /// Welcome to clang tools.
5 | ///
6 | /// This documentation describes the **internal** software that makes
7 | /// up clang tools, not the **external** use of clang tools. For
8 | /// usage instructions, please see the programmer's guide or reference
9 | /// manual.
10 |
--------------------------------------------------------------------------------
/modularize/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Option
3 | Support
4 | )
5 |
6 | add_clang_tool(modularize
7 | Modularize.cpp
8 | ModuleAssistant.cpp
9 | ModularizeUtilities.cpp
10 | CoverageChecker.cpp
11 | PreprocessorTracker.cpp
12 | )
13 |
14 | target_link_libraries(modularize
15 | PRIVATE
16 | clangAST
17 | clangBasic
18 | clangDriver
19 | clangFrontend
20 | clangLex
21 | clangSerialization
22 | clangTooling
23 | )
24 |
25 | install(TARGETS modularize
26 | RUNTIME DESTINATION bin
27 | COMPONENT clang-extras)
28 |
--------------------------------------------------------------------------------
/pp-trace/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Support
3 | )
4 |
5 | add_clang_executable(pp-trace
6 | PPTrace.cpp
7 | PPCallbacksTracker.cpp
8 | )
9 |
10 | target_link_libraries(pp-trace
11 | PRIVATE
12 | clangAST
13 | clangBasic
14 | clangFrontend
15 | clangLex
16 | clangSerialization
17 | clangTooling
18 | )
19 |
--------------------------------------------------------------------------------
/test/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: LLVM
2 | ColumnLimit: 0
3 |
--------------------------------------------------------------------------------
/test/Unit/lit.site.cfg.py.in:
--------------------------------------------------------------------------------
1 | @LIT_SITE_CFG_IN_HEADER@
2 |
3 | config.extra_tools_obj_dir = "@CLANG_TOOLS_BINARY_DIR@/unittests"
4 | config.extra_tools_src_dir = "@CLANG_TOOLS_SOURCE_DIR@/unittests"
5 | config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
6 | config.shlibdir = "@SHLIBDIR@"
7 | config.target_triple = "@TARGET_TRIPLE@"
8 |
9 | lit_config.load_config(config, "@CLANG_TOOLS_SOURCE_DIR@/test/Unit/lit.cfg.py")
10 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/ClangRenameClassReplacements.cpp:
--------------------------------------------------------------------------------
1 | // RUN: rm -rf %t
2 | // RUN: mkdir -p %t/fixes
3 | // RUN: cat %s > %t.cpp
4 | // RUN: clang-rename -offset=254 -new-name=Bar -export-fixes=%t/fixes/clang-rename.yaml %t.cpp --
5 | // RUN: clang-apply-replacements %t
6 | // RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
7 |
8 | class Foo {}; // CHECK: class Bar {};
9 |
10 | // Use grep -FUbo 'Foo' to get the correct offset of Cla when changing
11 | // this file.
12 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/basic/file2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: source2.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-basic
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/basic.h
8 | FileOffset: 148
9 | Replacements:
10 | - FilePath: $(path)/../basic/basic.h
11 | Offset: 298
12 | Length: 1
13 | ReplacementText: elem
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/conflict/common.h:
--------------------------------------------------------------------------------
1 | #ifndef COMMON_H
2 | #define COMMON_H
3 |
4 | extern void ext(int (&)[5]);
5 |
6 | void func(int t) {
7 | int ints[5];
8 | for (unsigned i = 0; i < 5; ++i) {
9 | ints[i] = t;
10 | }
11 |
12 | int *i = 0;
13 |
14 | ext(ints);
15 | }
16 |
17 | #endif // COMMON_H
18 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/conflict/file3.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: source1.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-conflict
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/common.h
8 | FileOffset: 169
9 | Replacements:
10 | - FilePath: $(path)/common.h
11 | Offset: 169
12 | Length: 0
13 | ReplacementText: "(int*)"
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/crlf/crlf.cpp:
--------------------------------------------------------------------------------
1 |
2 | // This file intentionally uses a CRLF newlines!
3 |
4 | void foo() {
5 | int *x = 0;
6 | }
7 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/crlf/crlf.cpp.expected:
--------------------------------------------------------------------------------
1 |
2 | // This file intentionally uses a CRLF newlines!
3 |
4 | void foo() {
5 | int *x = nullptr;
6 | }
7 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/crlf/file1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: source1.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-crlf
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/crlf.cpp
8 | FileOffset: 79
9 | Replacements:
10 | - FilePath: $(path)/crlf.cpp
11 | Offset: 79
12 | Length: 1
13 | ReplacementText: nullptr
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/format/no.cpp:
--------------------------------------------------------------------------------
1 | class C {};
2 |
3 | void f() { // This comment necessary to prevent formatting as void f() { ... }
4 | C *a = new C();
5 | // CHECK: {{^\ \ auto\ a\ \=\ new\ C\(\);}}
6 | }
7 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/format/no.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: no.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-no
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/no.cpp
8 | FileOffset: 94
9 | Replacements:
10 | - FilePath: $(path)/no.cpp
11 | Offset: 94
12 | Length: 3
13 | ReplacementText: 'auto '
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/identical/file1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: identical.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-identical-insertion
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/identical.cpp
8 | FileOffset: 12
9 | Replacements:
10 | - FilePath: $(path)/identical.cpp
11 | Offset: 12
12 | Length: 0
13 | ReplacementText: '0'
14 | ...
15 |
16 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/identical/file2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: identical.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-identical-insertion
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/identical.cpp
8 | FileOffset: 12
9 | Replacements:
10 | - FilePath: $(path)/identical.cpp
11 | Offset: 12
12 | Length: 0
13 | ReplacementText: '0'
14 | ...
15 |
16 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/identical/identical.cpp:
--------------------------------------------------------------------------------
1 | class MyType {};
2 | // CHECK: class MyType0 {};
3 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/invalid-files/invalid-files.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: ''
3 | Replacements:
4 | - FilePath: idontexist.h
5 | Offset: 2669
6 | Length: 0
7 | ReplacementText: ' override'
8 | - FilePath: idontexist.h
9 | Offset: 2669
10 | Length: 0
11 | ReplacementText: ' override'
12 | ...
13 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/order-dependent/expected.txt:
--------------------------------------------------------------------------------
1 | The new insertion has the same insert location as an existing replacement.
2 | New replacement: $(path)/order-dependent.cpp: 12:+0:"1"
3 | Existing replacement: $(path)/order-dependent.cpp: 12:+0:"0"
4 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/order-dependent/file1.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: order-dependent.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-order-dependent-insertion
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/order-dependent.cpp
8 | FileOffset: 12
9 | Replacements:
10 | - FilePath: $(path)/order-dependent.cpp
11 | Offset: 12
12 | Length: 0
13 | ReplacementText: '0'
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/order-dependent/file2.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | MainSourceFile: order-dependent.cpp
3 | Diagnostics:
4 | - DiagnosticName: test-order-dependent-insertion
5 | DiagnosticMessage:
6 | Message: Fix
7 | FilePath: $(path)/order-dependent.cpp
8 | FileOffset: 12
9 | Replacements:
10 | - FilePath: $(path)/order-dependent.cpp
11 | Offset: 12
12 | Length: 0
13 | ReplacementText: '1'
14 | ...
15 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/Inputs/order-dependent/order-dependent.cpp:
--------------------------------------------------------------------------------
1 | class MyType {};
2 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/crlf.cpp:
--------------------------------------------------------------------------------
1 | // RUN: mkdir -p %T/Inputs/crlf
2 | // RUN: cat %S/Inputs/crlf/crlf.cpp > %T/Inputs/crlf/crlf.cpp
3 | // RUN: sed "s#\$(path)#%/T/Inputs/crlf#" %S/Inputs/crlf/file1.yaml > %T/Inputs/crlf/file1.yaml
4 | // RUN: clang-apply-replacements %T/Inputs/crlf
5 | // RUN: diff %T/Inputs/crlf/crlf.cpp %S/Inputs/crlf/crlf.cpp.expected
6 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/identical.cpp:
--------------------------------------------------------------------------------
1 | // RUN: mkdir -p %T/Inputs/identical
2 | // RUN: grep -Ev "// *[A-Z-]+:" %S/Inputs/identical/identical.cpp > %T/Inputs/identical/identical.cpp
3 | // RUN: sed "s#\$(path)#%/T/Inputs/identical#" %S/Inputs/identical/file1.yaml > %T/Inputs/identical/file1.yaml
4 | // RUN: sed "s#\$(path)#%/T/Inputs/identical#" %S/Inputs/identical/file2.yaml > %T/Inputs/identical/file2.yaml
5 | // RUN: clang-apply-replacements %T/Inputs/identical
6 | // RUN: FileCheck -input-file=%T/Inputs/identical/identical.cpp %S/Inputs/identical/identical.cpp
7 |
--------------------------------------------------------------------------------
/test/clang-apply-replacements/invalid-files.cpp:
--------------------------------------------------------------------------------
1 | // RUN: mkdir -p %T/invalid-files
2 | // RUN: cp %S/Inputs/invalid-files/invalid-files.yaml %T/invalid-files/invalid-files.yaml
3 | // RUN: clang-apply-replacements %T/invalid-files
4 | //
5 | // Check that the yaml files are *not* deleted after running clang-apply-replacements without remove-change-desc-files.
6 | // RUN: ls %T/invalid-files/invalid-files.yaml
7 |
--------------------------------------------------------------------------------
/test/clang-change-namespace/Inputs/fake-std.h:
--------------------------------------------------------------------------------
1 | namespace std {
2 | class STD {};
3 | }
4 |
5 | using namespace std;
6 |
--------------------------------------------------------------------------------
/test/clang-change-namespace/simple-move.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" %s -- | sed 's,// CHECK.*,,' | FileCheck %s
2 | // CHECK: namespace x {
3 | // CHECK-NEXT: namespace y {
4 | namespace na {
5 | namespace nb {
6 | class A {};
7 | // CHECK: } // namespace y
8 | // CHECK-NEXT: } // namespace x
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test/clang-change-namespace/white-list.cpp:
--------------------------------------------------------------------------------
1 | // RUN: echo "^std::.*$" > %T/white-list.txt
2 | // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" --whitelist_file %T/white-list.txt %s -- | sed 's,// CHECK.*,,' | FileCheck %s
3 |
4 | #include "Inputs/fake-std.h"
5 |
6 | // CHECK: namespace x {
7 | // CHECK-NEXT: namespace y {
8 | namespace na {
9 | namespace nb {
10 | void f() {
11 | std::STD x1;
12 | STD x2;
13 | // CHECK: {{^}} std::STD x1;{{$}}
14 | // CHECK-NEXT: {{^}} STD x2;{{$}}
15 | }
16 | // CHECK: } // namespace y
17 | // CHECK-NEXT: } // namespace x
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/Inputs/database_template.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "directory": "test_dir/build",
4 | "command": "clang++ -I../include -o bar.o test_dir/src/bar.cpp",
5 | "file": "test_dir/src/bar.cpp"
6 | }
7 | ]
8 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/Inputs/merge/a.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | Name: foo
3 | Contexts:
4 | - ContextType: Namespace
5 | ContextName: a
6 | FilePath: foo.h
7 | Type: Class
8 | Seen: 1
9 | Used: 1
10 | ...
11 | ---
12 | Name: bar
13 | Contexts:
14 | - ContextType: Namespace
15 | ContextName: a
16 | FilePath: ../include/bar.h
17 | Type: Class
18 | Seen: 1
19 | Used: 2
20 | ...
21 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/Inputs/merge/b.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | Name: foo
3 | Contexts:
4 | - ContextType: Namespace
5 | ContextName: a
6 | FilePath: foo.h
7 | Type: Class
8 | Seen: 1
9 | Used: 2
10 | ...
11 | ---
12 | Name: bar
13 | Contexts:
14 | - ContextType: Namespace
15 | ContextName: a
16 | FilePath: ../include/barbar.h
17 | Type: Class
18 | Seen: 1
19 | Used: 0
20 | ...
21 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/exit_on_fatal.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e 's#//.*$##' %s > %t.cpp
2 | // RUN: not clang-include-fixer -db=fixed -input='foo= "foo.h"' %t.cpp --
3 | // RUN: FileCheck %s -input-file=%t.cpp
4 |
5 | // CHECK-NOT: #include
6 | // CHECK: #include "doesnotexist.h"
7 | // CHECK-NEXT: foo f;
8 |
9 | #include "doesnotexist.h"
10 | foo f;
11 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/fixeddb.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e 's#//.*$##' %s > %t.cpp
2 | // RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' %t.cpp --
3 | // RUN: FileCheck %s -input-file=%t.cpp
4 |
5 | // CHECK: #include "foo.h"
6 | // CHECK: foo f;
7 |
8 | foo f;
9 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/prefix_variable.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e 's#//.*$##' %s > %t.cpp
2 | // RUN: clang-include-fixer -db=yaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
3 | // RUN: FileCheck %s -input-file=%t.cpp
4 |
5 | // CHECK-NOT: #include
6 | // CHECK: doesnotexist f;
7 |
8 | namespace b {
9 | doesnotexist f;
10 | }
11 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/query_symbol.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-include-fixer -db=fixed -input='foo= "foo.h","bar.h"' -query-symbol="foo" test.cpp -- | FileCheck %s
2 |
3 | // CHECK: "FilePath": "test.cpp",
4 | // CHECK-NEXT:"QuerySymbolInfos": [
5 | // CHECK-NEXT: {"RawIdentifier": "foo",
6 | // CHECK-NEXT: "Range":{"Offset":0,"Length":0}}
7 | // CHECK-NEXT:],
8 | // CHECK-NEXT:"HeaderInfos": [
9 | // CHECK-NEXT: {"Header": "\"foo.h\"",
10 | // CHECK-NEXT: "QualifiedName": "foo"},
11 | // CHECK-NEXT: {"Header": "\"bar.h\"",
12 | // CHECK-NEXT: "QualifiedName": "foo"}
13 | // CHECK-NEXT:]
14 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/yaml_fuzzy.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e 's#//.*$##' %s > %t.cpp
2 | // RUN: clang-include-fixer -db=fuzzyYaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
3 | // RUN: FileCheck %s -input-file=%t.cpp
4 |
5 | // clang-include-fixer will add the include, but doesn't complete the symbol.
6 | // CHECK: #include "foobar.h"
7 | // CHECK: fba f;
8 |
9 | b::a::fba f;
10 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/yamldb.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e 's#//.*$##' %s > %t.cpp
2 | // RUN: clang-include-fixer -db=yaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
3 | // RUN: FileCheck %s -input-file=%t.cpp
4 |
5 | // CHECK: #include "foo.h"
6 | // CHECK: b::a::foo f;
7 |
8 | b::a::foo f;
9 |
--------------------------------------------------------------------------------
/test/clang-include-fixer/yamldb_autodetect.cpp:
--------------------------------------------------------------------------------
1 | // RUN: mkdir -p %T/foo/bar
2 | // RUN: cp %p/Inputs/fake_yaml_db.yaml %T/find_all_symbols_db.yaml
3 | // RUN: cd %T/foo
4 | // RUN: sed -e 's#//.*$##' %s > bar/test.cpp
5 | // RUN: clang-include-fixer -db=yaml bar/test.cpp --
6 | // RUN: FileCheck %s -input-file=bar/test.cpp
7 |
8 | // CHECK: #include "foo.h"
9 | // CHECK: b::a::foo f;
10 |
11 | b::a::foo f;
12 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/database_template.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "directory": "$test_dir/build",
4 | "command": "clang++ -o test.o -I../include $test_dir/src/test.cpp",
5 | "file": "$test_dir/src/test.cpp"
6 | }
7 | ]
8 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/enum.h:
--------------------------------------------------------------------------------
1 | namespace a {
2 | enum E1 { Green, Red };
3 |
4 | enum class E2 { Yellow };
5 |
6 | class C {
7 | enum E3 { Blue };
8 | };
9 | } // namespace a
10 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/function_test.cpp:
--------------------------------------------------------------------------------
1 | #include "function_test.h"
2 |
3 | void f() {}
4 |
5 | void A::f() {}
6 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/function_test.h:
--------------------------------------------------------------------------------
1 | void f();
2 |
3 | inline int g() { return 0; }
4 |
5 | template
6 | void h(T t) {}
7 |
8 | template<>
9 | void h(int t) {}
10 |
11 | class A {
12 | public:
13 | void f();
14 | };
15 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/helper_decls_test.h:
--------------------------------------------------------------------------------
1 | namespace a {
2 | class Class1 {
3 | void f();
4 | };
5 |
6 | class Class2 {
7 | void f();
8 | };
9 |
10 | class Class3 {
11 | void f();
12 | };
13 |
14 | class Class4 {
15 | void f();
16 | };
17 |
18 | class Class5 {
19 | void f();
20 | };
21 |
22 | class Class6 {
23 | int f();
24 | };
25 |
26 | class Class7 {
27 | int f();
28 | int g();
29 | };
30 |
31 | void Fun1();
32 |
33 | inline void Fun2() {}
34 |
35 | } // namespace a
36 |
37 | namespace b {
38 | void Fun3();
39 | } // namespace b
40 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/macro_helper_test.cpp:
--------------------------------------------------------------------------------
1 | #include "macro_helper_test.h"
2 |
3 | #define DEFINE(name) \
4 | namespace ns { \
5 | static const bool t1 = false; \
6 | bool t2_##name = t1; \
7 | bool t3_##name = t1; \
8 | } \
9 | using ns::t2_##name;
10 |
11 | DEFINE(test)
12 |
13 | void f1() {}
14 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/macro_helper_test.h:
--------------------------------------------------------------------------------
1 | class A {};
2 | void f1();
3 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/multiple_class_test.h:
--------------------------------------------------------------------------------
1 | namespace a {
2 | class Move1 {
3 | public:
4 | int f();
5 | };
6 | } // namespace a
7 |
8 | namespace b {
9 | class Move2 {
10 | public:
11 | int f();
12 | };
13 | } // namespace b
14 |
15 | namespace c {
16 | class Move3 {
17 | public:
18 | int f();
19 | };
20 |
21 | class Move4 {
22 | public:
23 | int f();
24 | };
25 |
26 | class EnclosingMove5 {
27 | public:
28 | class Nested {
29 | int f();
30 | static int b;
31 | };
32 | static int a;
33 | };
34 |
35 | class NoMove {
36 | public:
37 | int f();
38 | };
39 | } // namespace c
40 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/template_class_test.cpp:
--------------------------------------------------------------------------------
1 | #include "template_class_test.h"
2 |
3 | template
4 | void A::g() {}
5 |
6 | template
7 | template
8 | void A::k() {}
9 |
10 | template
11 | int A::c = 2;
12 |
13 | void B::f() {}
14 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/template_class_test.h:
--------------------------------------------------------------------------------
1 | #ifndef TEMPLATE_CLASS_TEST_H // comment 1
2 | #define TEMPLATE_CLASS_TEST_H
3 |
4 | template
5 | class A {
6 | public:
7 | void f();
8 | void g();
9 | template void h();
10 | template void k();
11 | static int b;
12 | static int c;
13 | };
14 |
15 | template
16 | void A::f() {}
17 |
18 | template
19 | template
20 | void A::h() {}
21 |
22 | template
23 | int A::b = 2;
24 |
25 | class B {
26 | public:
27 | void f();
28 | };
29 |
30 | #endif // TEMPLATE_CLASS_TEST_H
31 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/test.cpp:
--------------------------------------------------------------------------------
1 | #include "test.h"
2 | #include "test2.h"
3 |
4 | namespace a {
5 | int Foo::f() {
6 | return 0;
7 | }
8 | int Foo::f2(int a, int b) {
9 | return a + b;
10 | }
11 | } // namespace a
12 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/test.h:
--------------------------------------------------------------------------------
1 | #ifndef TEST_H // comment 1
2 | #define TEST_H
3 | namespace a {
4 | class Foo {
5 | public:
6 | int f();
7 | int f2(int a, int b);
8 | };
9 | } // namespace a
10 | #endif // TEST_H
11 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/type_alias.h:
--------------------------------------------------------------------------------
1 | typedef int Int1;
2 | using Int2 = int;
3 |
4 | template
5 | struct A {};
6 |
7 | template using B = A;
8 |
9 | class C {
10 | typedef int Int3;
11 | };
12 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/var_test.cpp:
--------------------------------------------------------------------------------
1 | #include "var_test.h"
2 |
3 | namespace a{
4 | int kGlobalInt = 1;
5 | const char *const kGlobalStr = "Hello";
6 | }
7 |
--------------------------------------------------------------------------------
/test/clang-move/Inputs/var_test.h:
--------------------------------------------------------------------------------
1 | namespace a {
2 | extern int kGlobalInt;
3 | extern const char *const kGlobalStr;
4 | }
5 |
6 | int kEvilInt = 2;
7 |
8 | inline void f1() {
9 | int kGlobalInt = 3;
10 | const char *const kGlobalStr = "Hello2";
11 | }
12 |
--------------------------------------------------------------------------------
/test/clang-query/Inputs/foo.script:
--------------------------------------------------------------------------------
1 | foo
2 | bar
3 |
--------------------------------------------------------------------------------
/test/clang-query/errors.c:
--------------------------------------------------------------------------------
1 | // RUN: not clang-query -c foo -c bar %s -- | FileCheck %s
2 | // RUN: not clang-query -f %S/Inputs/foo.script %s -- | FileCheck %s
3 | // RUN: not clang-query -f %S/Inputs/nonexistent.script %s -- 2>&1 | FileCheck --check-prefix=CHECK-NONEXISTENT %s
4 | // RUN: not clang-query -c foo -f foo %s -- 2>&1 | FileCheck --check-prefix=CHECK-BOTH %s
5 |
6 | // CHECK: unknown command: foo
7 | // CHECK-NOT: unknown command: bar
8 |
9 | // CHECK-NONEXISTENT: cannot open {{.*}}nonexistent.script
10 | // CHECK-BOTH: cannot specify both -c and -f
11 |
--------------------------------------------------------------------------------
/test/clang-query/function-decl.c:
--------------------------------------------------------------------------------
1 | // RUN: clang-query -c "match functionDecl()" %s -- | FileCheck %s
2 |
3 | // CHECK: function-decl.c:4:1: note: "root" binds here
4 | void foo(void) {}
5 |
--------------------------------------------------------------------------------
/test/clang-reorder-fields/AggregatePartialInitialization.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- | FileCheck %s
2 |
3 | // The order of fields should not change.
4 | class Foo {
5 | public:
6 | int x; // CHECK: {{^ int x;}}
7 | int y; // CHECK-NEXT: {{^ int y;}}
8 | int z; // CHECK-NEXT: {{^ int z;}}
9 | };
10 |
11 | int main() {
12 | Foo foo = { 0, 1 }; // CHECK: {{^ Foo foo = { 0, 1 };}}
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/test/clang-reorder-fields/CStructAmbiguousName.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-reorder-fields -record-name ::Foo -fields-order y,x %s -- | FileCheck %s
2 |
3 | struct Foo {
4 | int x; // CHECK: {{^ double y;}}
5 | double y; // CHECK-NEXT: {{^ int x;}}
6 | };
7 |
8 | namespace bar {
9 | struct Foo {
10 | int x; // CHECK: {{^ int x;}}
11 | double y; // CHECK-NEXT: {{^ double y;}}
12 | };
13 | } // end namespace bar
14 |
15 | int main() {
16 | bar::Foo foo = { 1, 1.7 }; // CHECK: {{^ bar::Foo foo = { 1, 1.7 };}}
17 | return 0;
18 | }
19 |
--------------------------------------------------------------------------------
/test/clang-reorder-fields/CStructFieldsOrder.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,w,y,x %s -- | FileCheck %s
2 |
3 | namespace bar {
4 | struct Foo {
5 | const int* x; // CHECK: {{^ double z;}}
6 | int y; // CHECK-NEXT: {{^ int w;}}
7 | double z; // CHECK-NEXT: {{^ int y;}}
8 | int w; // CHECK-NEXT: {{^ const int\* x}}
9 | };
10 | } // end namespace bar
11 |
12 | int main() {
13 | const int x = 13;
14 | bar::Foo foo = { &x, 0, 1.29, 17 }; // CHECK: {{^ bar::Foo foo = { 1.29, 17, 0, &x };}}
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/test/clang-reorder-fields/ClassDifferentFieldsAccesses.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-reorder-fields -record-name Foo -fields-order z,y,x %s -- | FileCheck %s
2 |
3 | // The order of fields should not change.
4 | class Foo {
5 | public:
6 | int x; // CHECK: {{^ int x;}}
7 |
8 | private:
9 | int y; // CHECK: {{^ int y;}}
10 | int z; // CHECK-NEXT: {{^ int z;}}
11 | };
12 |
13 | int main() {
14 | Foo foo;
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/test/clang-reorder-fields/PlainCStructFieldsOrder.c:
--------------------------------------------------------------------------------
1 | // RUN: clang-reorder-fields -record-name Foo -fields-order z,w,y,x %s -- | FileCheck %s
2 |
3 | struct Foo {
4 | const int* x; // CHECK: {{^ double z;}}
5 | int y; // CHECK-NEXT: {{^ int w;}}
6 | double z; // CHECK-NEXT: {{^ int y;}}
7 | int w; // CHECK-NEXT: {{^ const int\* x}}
8 | };
9 |
10 | int main() {
11 | const int x = 13;
12 | struct Foo foo = { &x, 0, 1.29, 17 }; // CHECK: {{^ struct Foo foo = { 1.29, 17, 0, &x };}}
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/a.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/b.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/clang-c/c.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/clang/b.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/cross-file-a.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/cross-file-b.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/cross-file-c.h:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | // The line number of the following include should match the location of the
40 | // corresponding comment in llvm-include-order.cpp
41 | #include "cross-file-b.h"
42 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/gtest/foo.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/i.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/j.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/llvm-c/d.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/llvm/a.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/s.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/Headers/stdio.h:
--------------------------------------------------------------------------------
1 | //===--- stdio.h - Stub header for tests ------------------------*- C++ -*-===//
2 | //
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 | // See https://llvm.org/LICENSE.txt for license information.
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 | //
7 | //===----------------------------------------------------------------------===//
8 |
9 | #ifndef _STDIO_H_
10 | #define _STDIO_H_
11 |
12 | // A header intended to contain C standard input and output library
13 | // declarations.
14 |
15 | int printf(const char *, ...);
16 |
17 | #endif // _STDIO_H_
18 |
19 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/absl/external-file.h:
--------------------------------------------------------------------------------
1 | namespace absl {
2 | namespace base_internal {
3 | void InternalFunction() {}
4 | } // namespace base_internal
5 | } //namespace absl
6 | void DirectAccess2() { absl::base_internal::InternalFunction(); }
7 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/absl/flags/internal-file.h:
--------------------------------------------------------------------------------
1 | #define USE_INTERNAL(x) absl::strings_internal::Internal##x()
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/config-files/.clang-tidy:
--------------------------------------------------------------------------------
1 | Checks: 'from-parent'
2 | HeaderFilterRegex: 'parent'
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/config-files/1/.clang-tidy:
--------------------------------------------------------------------------------
1 | Checks: 'from-child1'
2 | HeaderFilterRegex: 'child1'
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/expand-modular-headers-ppcallbacks/a.h:
--------------------------------------------------------------------------------
1 | #define a
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/expand-modular-headers-ppcallbacks/b.h:
--------------------------------------------------------------------------------
1 | #include "a.h"
2 | #define b
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/expand-modular-headers-ppcallbacks/c.h:
--------------------------------------------------------------------------------
1 | #include "b.h"
2 | #define c
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/expand-modular-headers-ppcallbacks/module.modulemap:
--------------------------------------------------------------------------------
1 | module a { header "a.h" export * }
2 | module b { header "b.h" export * use a }
3 | module c { header "c.h" export * use b }
4 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/explain-config/.clang-tidy:
--------------------------------------------------------------------------------
1 | Checks: '-*,modernize-use-nullptr'
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/file-filter/header1.h:
--------------------------------------------------------------------------------
1 | class A1 { A1(int); };
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/file-filter/header2.h:
--------------------------------------------------------------------------------
1 | class A2 { A2(int); };
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/file-filter/system/system-header.h:
--------------------------------------------------------------------------------
1 | class A0 { A0(int); };
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/a.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/cstdarg.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/cstdlib.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/j.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/r.h:
--------------------------------------------------------------------------------
1 | void f() {}
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/s.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/t.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/system/transitive.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/fuchsia-restrict-system-includes/transitive2.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/google-namespaces.h:
--------------------------------------------------------------------------------
1 | namespace {
2 | int x;
3 | }
4 |
5 | namespace spaaaace {
6 | class core;
7 | }
8 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/line-filter/header1.h:
--------------------------------------------------------------------------------
1 | class A1 { A1(int); };
2 | class B1 { B1(int); };
3 | class C1 { C1(int); };
4 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/line-filter/header2.h:
--------------------------------------------------------------------------------
1 | class A2 { A2(int); };
2 | class B2 { B2(int); };
3 | class C2 { C2(int); };
4 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/line-filter/header3.h:
--------------------------------------------------------------------------------
1 | class A3 { A3(int); };
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/mock-libcxx/bin/clang:
--------------------------------------------------------------------------------
1 | This file is a placeholder to keep its parent directory in git.
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/mock-libcxx/include/c++/v1/mock_vector:
--------------------------------------------------------------------------------
1 | class vector {};
2 | typedef vector* vector_ptr;
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/assert.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/complex.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/ctype.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/errno.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/fenv.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/float.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/inttypes.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/iso646.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/limits.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/locale.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/math.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/setjmp.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/signal.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdalign.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdarg.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdbool.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stddef.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdint.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdio.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/stdlib.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/string.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/tgmath.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/time.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/uchar.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/wchar.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-deprecated-headers/wctype.h:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-pass-by-value/header-with-fix.h:
--------------------------------------------------------------------------------
1 | struct S {
2 | S(S&&);
3 | S(const S&);
4 | };
5 | struct Foo {
6 | Foo(const S &s);
7 | S s;
8 | };
9 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-pass-by-value/header.h:
--------------------------------------------------------------------------------
1 | class ThreadId {
2 | public:
3 | ThreadId(const ThreadId &) {}
4 | ThreadId(ThreadId &&) {}
5 | };
6 |
7 | struct A {
8 | A(const ThreadId &tid) : threadid(tid) {}
9 | ThreadId threadid;
10 | };
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/modernize-smart-ptr/shared_ptr.h:
--------------------------------------------------------------------------------
1 | namespace std {
2 |
3 | template
4 | class shared_ptr {
5 | public:
6 | shared_ptr();
7 | shared_ptr(type *ptr);
8 | shared_ptr(const shared_ptr &t) {}
9 | shared_ptr(shared_ptr &&t) {}
10 | ~shared_ptr();
11 | type &operator*() { return *ptr; }
12 | type *operator->() { return ptr; }
13 | type *release();
14 | void reset();
15 | void reset(type *pt);
16 | shared_ptr &operator=(shared_ptr &&);
17 | template
18 | shared_ptr &operator=(shared_ptr &&);
19 |
20 | private:
21 | type *ptr;
22 | };
23 |
24 | } // namespace std
25 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/nolint/trigger_warning.h:
--------------------------------------------------------------------------------
1 | void A1(const int &In, int &Out) {
2 | if (In > 123) // NOLINT
3 | Out = 123;
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/overlapping/o.h:
--------------------------------------------------------------------------------
1 | // run: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \
2 | // run: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \
3 | // run: not grep "note: this fix will not be applied because it overlaps with another fix"
4 |
5 | #include "b.h"
6 | #include "a.h"
7 |
8 | // The comments above are there to match the offset of the #include with the
9 | // offset of the #includes in the .cpp file.
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/performance-unnecessary-value-param/header-fixed.h:
--------------------------------------------------------------------------------
1 | // struct ABC is expensive to copy and should be
2 | // passed as a const referece.
3 | struct ABC {
4 | ABC(const ABC&);
5 | int get(int) const;
6 | };
7 |
8 |
9 | int f1(int n, const ABC& v1, const ABC& v2); // line 9
10 |
11 | int f1(int n, ABC v1); // line 11
12 |
13 |
14 |
15 | int f2( int n, const ABC& v2); // line 15
16 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/performance-unnecessary-value-param/header.h:
--------------------------------------------------------------------------------
1 | // struct ABC is expensive to copy and should be
2 | // passed as a const referece.
3 | struct ABC {
4 | ABC(const ABC&);
5 | int get(int) const;
6 | };
7 |
8 |
9 | int f1(int n, ABC v1, ABC v2); // line 9
10 |
11 | int f1(int n, ABC v1); // line 11
12 |
13 |
14 |
15 | int f2( int n, ABC v2); // line 15
16 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/readability-identifier-naming/system/system-header.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEM_HEADER_H
2 | #define SYSTEM_HEADER_H
3 |
4 | #define SYSTEM_MACRO(m) int m = 0
5 |
6 | namespace SYSTEM_NS {
7 | class structure {
8 | int member;
9 | };
10 |
11 | float global;
12 |
13 | void function() {
14 | }
15 | }
16 |
17 | #endif // SYSTEM_HEADER_H
18 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/readability-identifier-naming/user-header.h:
--------------------------------------------------------------------------------
1 | #ifndef USER_HEADER_H
2 | #define USER_HEADER_H
3 |
4 | #define USER_MACRO(m) int m = 0
5 |
6 | namespace USER_NS {
7 | class object {
8 | int member;
9 | };
10 |
11 | float global;
12 |
13 | void function() {
14 | }
15 | }
16 |
17 | #endif // USER_HEADER_H
18 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/unused-using-decls.h:
--------------------------------------------------------------------------------
1 | class MyClass {
2 | public:
3 | template class S, typename T>
4 | S *func1(T *a) {
5 | return new S();
6 | }
7 | template
8 | void func2(T a) {
9 | S();
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/vfsoverlay/actual_header.h:
--------------------------------------------------------------------------------
1 | struct X {};
2 |
--------------------------------------------------------------------------------
/test/clang-tidy/Inputs/vfsoverlay/vfsoverlay.yaml:
--------------------------------------------------------------------------------
1 | {
2 | 'version': 0,
3 | 'roots': [
4 | { 'name': 'OUT_DIR', 'type': 'directory',
5 | 'contents': [
6 | { 'name': 'not_real.h', 'type': 'file',
7 | 'external-contents': 'INPUT_DIR/actual_header.h'
8 | }
9 | ]
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/alternative-fixes.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s "llvm-namespace-comment,clang-diagnostic-*" %t
2 | void foo(int a) {
3 | if (a = 1) {
4 | // CHECK-NOTES: [[@LINE-1]]:9: warning: using the result of an assignment as a condition without parentheses [clang-diagnostic-parentheses]
5 | // CHECK-NOTES: [[@LINE-2]]:9: note: place parentheses around the assignment to silence this warning
6 | // CHECK-NOTES: [[@LINE-3]]:9: note: use '==' to turn this assignment into an equality comparison
7 | // CHECK-FIXES: if ((a = 1)) {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/android-cloexec-inotify-init.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s android-cloexec-inotify-init %t
2 |
3 | extern "C" int inotify_init();
4 |
5 | void f() {
6 | inotify_init();
7 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
8 | // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
9 | }
10 |
11 | namespace i {
12 | int inotify_init();
13 | void g() {
14 | inotify_init();
15 | }
16 | } // namespace i
17 |
18 | class C {
19 | public:
20 | int inotify_init();
21 | void h() {
22 | inotify_init();
23 | }
24 | };
25 |
--------------------------------------------------------------------------------
/test/clang-tidy/basic.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- | FileCheck %s
2 | // RUN: c-index-test -test-load-source-reparse 2 all %s -Xclang -add-plugin -Xclang clang-tidy -Xclang -plugin-arg-clang-tidy -Xclang -checks='-*,llvm-namespace-comment' 2>&1 | FileCheck %s
3 |
4 | namespace i {
5 | }
6 | // CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment]
7 |
--------------------------------------------------------------------------------
/test/clang-tidy/bugprone-macro-parentheses-cmdline.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s bugprone-macro-parentheses %t -- -- -DVAL=0+0
2 |
3 | // The previous command-line is producing warnings and fixes with the source
4 | // locations from a virtual buffer. VAL is replaced by '0+0'.
5 | // Fixes could not be applied and should not be reported.
6 | int foo() { return VAL; }
7 |
8 | #define V 0+0
9 | int bar() { return V; }
10 | // CHECK-FIXES: #define V (0+0)
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/bugprone-undelegated-constructor-cxx98.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,bugprone-undelegated-constructor -- -std=c++98 | count 0
2 |
3 | // Note: this test expects no diagnostics, but FileCheck cannot handle that,
4 | // hence the use of | count 0.
5 |
6 | struct Ctor;
7 | Ctor foo();
8 |
9 | struct Ctor {
10 | Ctor();
11 | Ctor(int);
12 | Ctor(int, int);
13 | Ctor(Ctor *i) {
14 | Ctor();
15 | Ctor(0);
16 | Ctor(1, 2);
17 | foo();
18 | }
19 | };
20 |
21 | Ctor::Ctor() {
22 | Ctor(1);
23 | }
24 |
--------------------------------------------------------------------------------
/test/clang-tidy/cert-flp30-c.c:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s cert-flp30-c %t
2 |
3 | float g(void);
4 |
5 | void func(void) {
6 | for (float x = 0.1f; x <= 1.0f; x += 0.1f) {}
7 | // CHECK-MESSAGES: :[[@LINE-1]]:37: warning: loop induction expression should not have floating-point type [cert-flp30-c]
8 |
9 | float f = 1.0f;
10 | for (; f > 0; --f) {}
11 | // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: loop induction expression
12 |
13 | for (;;g()) {}
14 | // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: loop induction expression
15 |
16 | for (int i = 0; i < 10; i += 1.0f) {}
17 |
18 | for (int i = 0; i < 10; ++i) {}
19 | }
20 |
--------------------------------------------------------------------------------
/test/clang-tidy/cert-limited-randomness.c:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s cert-msc30-c %t
2 |
3 | extern int rand(void);
4 | int nonrand();
5 |
6 | int cTest() {
7 | int i = rand();
8 | // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness [cert-msc30-c]
9 |
10 | int k = nonrand();
11 |
12 | return 0;
13 | }
14 |
--------------------------------------------------------------------------------
/test/clang-tidy/cert-oop54-cpp.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s cert-oop54-cpp %t
2 |
3 | // Test whether bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField option is set correctly.
4 | class TrivialFields {
5 | public:
6 | TrivialFields &operator=(const TrivialFields &object) {
7 | // CHECK-MESSAGES: [[@LINE-1]]:18: warning: operator=() does not handle self-assignment properly [cert-oop54-cpp]
8 | return *this;
9 | }
10 |
11 | private:
12 | int m;
13 | float f;
14 | double d;
15 | bool b;
16 | };
17 |
--------------------------------------------------------------------------------
/test/clang-tidy/clang-tidy-__clang_analyzer__macro.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,modernize-use-nullptr -- | count 0
2 |
3 | #if !defined(__clang_analyzer__)
4 | #error __clang_analyzer__ is not defined
5 | #endif
6 |
--------------------------------------------------------------------------------
/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++98-or-later %s cppcoreguidelines-pro-bounds-constant-array-index %t
2 |
3 | // Note: this test expects no diagnostics, but FileCheck cannot handle that,
4 | // hence the use of | count 0.
5 | template struct B {
6 | int get() {
7 | // The next line used to crash the check (in C++03 mode only).
8 | return x[index];
9 | // CHECK-FIXES: return x[index];
10 | }
11 | int x[3];
12 | };
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/cppcoreguidelines-pro-type-const-cast.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-const-cast %t
2 |
3 | const int *i;
4 | int *j;
5 | void f() { j = const_cast(i); }
6 | // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]
7 |
--------------------------------------------------------------------------------
/test/clang-tidy/cppcoreguidelines-pro-type-reinterpret-cast.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-reinterpret-cast %t
2 |
3 | int i = 0;
4 | void *j;
5 | void f() { j = reinterpret_cast(i); }
6 | // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: do not use reinterpret_cast [cppcoreguidelines-pro-type-reinterpret-cast]
7 |
--------------------------------------------------------------------------------
/test/clang-tidy/deduplication.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s google-explicit-constructor %t
2 |
3 | template
4 | struct A { A(T); };
5 | // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: single-argument constructors must be marked explicit
6 |
7 | void f() {
8 | A a(0);
9 | A b(0);
10 | }
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/enable-alpha-checks.cpp:
--------------------------------------------------------------------------------
1 | // REQUIRES: static-analyzer
2 |
3 | // Check if '-allow-enabling-analyzer-alpha-checkers' is visible for users.
4 | // RUN: clang-tidy -help | not grep 'allow-enabling-analyzer-alpha-checkers'
5 |
6 | // Check if '-allow-enabling-analyzer-alpha-checkers' enables alpha checks.
7 | // RUN: clang-tidy -checks=* -list-checks | not grep 'clang-analyzer-alpha'
8 | // RUN: clang-tidy -checks=* -list-checks -allow-enabling-analyzer-alpha-checkers | grep 'clang-analyzer-alpha'
9 |
--------------------------------------------------------------------------------
/test/clang-tidy/extra-args.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy -checks='-*,modernize-use-override' \
2 | // RUN: -config='{ExtraArgs: ["-DTEST4"], ExtraArgsBefore: ["-DTEST1"]}' \
3 | // RUN: -extra-arg=-DTEST3 -extra-arg-before=-DTEST2 %s -- -v 2>&1 \
4 | // RUN: | FileCheck -implicit-check-not='{{warning:|error:}}' %s
5 |
6 | // CHECK: {{^}}clang Invocation:{{$}}
7 | // CHECK-NEXT: {{"-D" "TEST1" .*"-D" "TEST2" .*"-D" "TEST3" .*"-D" "TEST4"}}
8 |
--------------------------------------------------------------------------------
/test/clang-tidy/fuchsia-restrict-system-includes-glob.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s fuchsia-restrict-system-includes %t \
2 | // RUN: -- -config="{CheckOptions: [{key: fuchsia-restrict-system-includes.Includes, value: 'cstd*'}]}" \
3 | // RUN: -- -I %S/Inputs/fuchsia-restrict-system-includes -isystem %S/Inputs/fuchsia-restrict-system-includes/system
4 |
5 | #include
6 | #include
7 | #include
8 | // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: system include t.h not allowed
9 | // CHECK-FIXES-NOT: #include
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/google-module.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy -checks='-*,google*' -config='{}' -dump-config - -- | FileCheck %s
2 | // CHECK: CheckOptions:
3 | // CHECK: {{- key: *google-readability-braces-around-statements.ShortStatementLines}}
4 | // CHECK-NEXT: {{value: *'1'}}
5 | // CHECK: {{- key: *google-readability-function-size.StatementThreshold}}
6 | // CHECK-NEXT: {{value: *'800'}}
7 | // CHECK: {{- key: *google-readability-namespace-comments.ShortNamespaceLines}}
8 | // CHECK-NEXT: {{value: *'10'}}
9 | // CHECK: {{- key: *google-readability-namespace-comments.SpacesBeforeComments}}
10 | // CHECK-NEXT: {{value: *'2'}}
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/google-objc-global-variable-declaration.mm:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s google-objc-global-variable-declaration %t
2 |
3 | @class NSString;
4 | static NSString* const myConstString = @"hello";
5 | // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: const global variable 'myConstString' must have a name which starts with an appropriate prefix [google-objc-global-variable-declaration]
6 | // CHECK-FIXES: static NSString* const kMyConstString = @"hello";
7 |
8 | class MyTest {
9 | static int not_objc_style;
10 | };
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/google-runtime-int.c:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy -checks=-*,google-runtime-int %s -- -x c 2>&1 | not grep 'warning:\|error:'
2 |
3 | long a();
4 |
5 | long b(long x);
6 |
7 | short bar(const short q, unsigned short w) {
8 | long double foo;
9 | unsigned short port;
10 |
11 | const unsigned short bar;
12 | long long *baar;
13 | const unsigned short bara;
14 | long const long moo;
15 | long volatile long wat;
16 | unsigned long y;
17 | unsigned long long **const *tmp;
18 | unsigned short porthole;
19 |
20 | unsigned cast;
21 | cast = (short)42;
22 | return q;
23 | }
24 |
25 | void qux() {
26 | short port;
27 | }
28 |
--------------------------------------------------------------------------------
/test/clang-tidy/hicpp-no-assembler-msvc.cpp:
--------------------------------------------------------------------------------
1 | // REQUIRES: system-windows
2 | // FIXME: Re-enable test on windows (PR36855)
3 | // UNSUPPORTED: system-windows
4 | // RUN: %check_clang_tidy %s hicpp-no-assembler %t
5 |
6 | void f() {
7 | _asm {
8 | mov al, 2;
9 | // CHECK-MESSAGES: :[[@LINE-2]]:3: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/test/clang-tidy/hicpp-no-assembler.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s hicpp-no-assembler %t
2 |
3 | __asm__(".symver foo, bar@v");
4 | // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler]
5 |
6 | static int s asm("spam");
7 | // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler]
8 |
9 | void f() {
10 | __asm("mov al, 2");
11 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not use inline assembler in safety-critical code [hicpp-no-assembler]
12 | }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/list-checks.cpp:
--------------------------------------------------------------------------------
1 | // RUN: mkdir -p %T/clang-tidy/list-checks/
2 | // RUN: echo '{Checks: "-*,google-*"}' > %T/clang-tidy/.clang-tidy
3 | // RUN: cd %T/clang-tidy/list-checks
4 | // RUN: clang-tidy -list-checks | grep "^ *google-"
5 |
--------------------------------------------------------------------------------
/test/clang-tidy/macros.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy -checks='-*,google-explicit-constructor' %s -- | FileCheck %s
2 |
3 | #define Q(name) class name { name(int i); }
4 |
5 | Q(A);
6 | // CHECK: :[[@LINE-1]]:3: warning: single-argument constructors must be marked explicit
7 | // CHECK: :3:30: note: expanded from macro 'Q'
8 |
--------------------------------------------------------------------------------
/test/clang-tidy/misc-definitions-in-headers-1z.hpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s misc-definitions-in-headers %t -- -- -std=c++1z
2 |
3 | class CE {
4 | constexpr static int i = 5; // OK: inline variable definition.
5 | };
6 |
7 | inline int i = 5; // OK: inline variable definition.
8 |
9 | int b = 1;
10 | // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: variable 'b' defined in a header file; variable definitions in header files can lead to ODR violations [misc-definitions-in-headers]
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/misc-misplaced-const-cxx17.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -expect-clang-tidy-error %s misc-misplaced-const %t -- -- -std=c++17
2 |
3 | // This test previously would cause a failed assertion because the structured
4 | // binding declaration had no valid type associated with it. This ensures the
5 | // expected clang diagnostic is generated instead.
6 | // CHECK-MESSAGES: :[[@LINE+1]]:6: error: decomposition declaration '[x]' requires an initializer [clang-diagnostic-error]
7 | auto [x];
8 |
9 | struct S { int a; };
10 | S f();
11 |
12 | int main() {
13 | auto [x] = f();
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/test/clang-tidy/misc-unconventional-assign-operator-cxx17.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++14-or-later %s misc-unconventional-assign-operator %t -- -- -fno-delayed-template-parsing
2 |
3 | struct BadModifier {
4 | BadModifier& operator=(const BadModifier&) const;
5 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: operator=() should not be marked 'const'
6 | };
7 |
8 | struct PR35468 {
9 | template auto &operator=(const T &) {
10 | return *this;
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/misc-unused-alias-decls.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s misc-unused-alias-decls %t
2 |
3 | namespace my_namespace {
4 | class C {};
5 | }
6 |
7 | namespace unused_alias = ::my_namespace; // eol-comments aren't removed (yet)
8 | // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: namespace alias decl 'unused_alias' is unused
9 | // CHECK-FIXES: {{^}}// eol-comments aren't removed (yet)
10 |
11 | namespace used_alias = ::my_namespace;
12 | void f() { used_alias::C c; }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/misc-unused-using-decls-errors.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -expect-clang-tidy-error %s misc-unused-using-decls %t
2 |
3 | namespace n {
4 | class C;
5 | }
6 |
7 | using n::C;
8 |
9 | void f() {
10 | for (C *p : unknown()) {}
11 | // CHECK-MESSAGES: :[[@LINE-1]]:15: error: use of undeclared identifier 'unknown' [clang-diagnostic-error]
12 | }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-loop-convert-assert-failure.cpp:
--------------------------------------------------------------------------------
1 | // RUN: not clang-tidy %s -checks=-*,modernize-loop-convert --
2 |
3 | // Note: this test expects no assert failure happened in clang-tidy.
4 |
5 | class LinguisticItem {
6 | LinguisticItem *x0;
7 | class x1 {
8 | bool operator!= ( const x1 &;
9 | operator* ( ;
10 | LinguisticItem * &operator-> ( ;
11 | operator++ (
12 | } begin() const;
13 | x1 end() const {
14 | LinguisticStream x2;
15 | for (x1 x3 = x2.begin x3 != x2.end; ++x3)
16 | x3->x0
17 | }
18 | };
19 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-loop-convert.c:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,modernize-loop-convert -- -std=c11 | count 0
2 |
3 | // Note: this test expects no diagnostics, but FileCheck cannot handle that,
4 | // hence the use of | count 0.
5 |
6 | int arr[6] = {1, 2, 3, 4, 5, 6};
7 |
8 | void f(void) {
9 | for (int i = 0; i < 6; ++i) {
10 | (void)arr[i];
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-make-unique-cxx11.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++11 %s modernize-make-unique %t -- -- -I %S/Inputs/modernize-smart-ptr
2 |
3 | #include "unique_ptr.h"
4 | // CHECK-FIXES: #include "unique_ptr.h"
5 |
6 | void f() {
7 | auto my_ptr = std::unique_ptr(new int(1));
8 | // CHECK-FIXES: auto my_ptr = std::unique_ptr(new int(1));
9 | }
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-pass-by-value-macro-header.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -isystem %S/Inputs/Headers
2 |
3 | // CHECK-FIXES: #include
4 |
5 | #define HEADER <./a.h>
6 | #include HEADER
7 |
8 | struct A {
9 | A(const A &) {}
10 | A(A &&) {}
11 | };
12 |
13 | struct B {
14 | B(const A &a) : a(a) {}
15 | // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move [modernize-pass-by-value]
16 | // CHECK-FIXES: B(A a) : a(std::move(a)) {}
17 | A a;
18 | };
19 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-default-member-init-bitfield.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++2a-or-later %s modernize-use-default-member-init %t
2 |
3 | struct PositiveBitField
4 | {
5 | PositiveBitField() : i(6) {}
6 | // CHECK-FIXES: PositiveBitField() {}
7 | int i : 5;
8 | // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use default member initializer for 'i' [modernize-use-default-member-init]
9 | // CHECK-FIXES: int i : 5{6};
10 | };
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-default-member-init-macros.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-use-default-member-init %t -- \
2 | // RUN: -config="{CheckOptions: [{key: modernize-use-default-member-init.IgnoreMacros, value: 0}]}"
3 |
4 | #define MACRO() \
5 | struct S { \
6 | void *P; \
7 | S() : P(nullptr) {} \
8 | };
9 |
10 | MACRO();
11 | // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use default member initializer for 'P'
12 |
13 | struct S2 {
14 | void *P;
15 | // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use default member initializer for 'P'
16 | S2() : P(nullptr) {}
17 | };
18 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-equals-default-delayed.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,modernize-use-equals-default -- -std=c++11 -fdelayed-template-parsing -fexceptions | count 0
2 | // Note: this test expects no diagnostics, but FileCheck cannot handle that,
3 | // hence the use of | count 0.
4 | // FIXME: Make the test work in all language modes.
5 |
6 | template
7 | struct S {
8 | S& operator=(const S&) { return *this; }
9 | };
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-equals-default-macros.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-use-equals-default %t -- \
2 | // RUN: -config="{CheckOptions: [{key: modernize-use-equals-default.IgnoreMacros, value: 0}]}"
3 |
4 | #define STRUCT_WITH_DEFAULT(_base, _type) \
5 | struct _type { \
6 | _type() {} \
7 | _base value; \
8 | };
9 |
10 | STRUCT_WITH_DEFAULT(unsigned char, InMacro)
11 | // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use '= default' to define a trivial default constructor
12 | // CHECK-MESSAGES: :[[@LINE-6]]:13: note:
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-equals-delete-macros.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-use-equals-delete %t -- \
2 | // RUN: -config="{CheckOptions: [{key: modernize-use-equals-delete.IgnoreMacros, value: 0}]}"
3 |
4 | #define MACRO(type) void operator=(type const &)
5 | class C {
6 | private:
7 | MACRO(C);
8 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use '= delete' to prohibit calling of a special member function
9 | };
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-nodiscard-no-macro-inscope-cxx11.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-use-nodiscard %t -- \
2 | // RUN: -config="{CheckOptions: [{key: modernize-use-nodiscard.ReplacementString, value: 'CUSTOM_NO_DISCARD'}]}"
3 |
4 | // As if the macro was not defined.
5 | // #define CUSTOM_NO_DISCARD __attribute_((warn_unused_result))
6 |
7 | class Foo
8 | {
9 | public:
10 | bool f1() const;
11 | // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: function 'f1' should be marked CUSTOM_NO_DISCARD [modernize-use-nodiscard]
12 | };
13 |
14 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-nullptr.c:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,modernize-use-nullptr -- | count 0
2 |
3 | // Note: this test expects no diagnostics, but FileCheck cannot handle that,
4 | // hence the use of | count 0.
5 |
6 | #define NULL 0
7 | void f(void) {
8 | char *str = NULL; // ok
9 | (void)str;
10 | }
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-override-cxx98.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++98 %s modernize-use-override %t
2 |
3 | struct Base {
4 | virtual ~Base() {}
5 | virtual void a();
6 | virtual void b();
7 | };
8 |
9 | struct SimpleCases : public Base {
10 | public:
11 | virtual ~SimpleCases();
12 | // CHECK-FIXES: {{^}} virtual ~SimpleCases();
13 |
14 | void a();
15 | // CHECK-FIXES: {{^}} void a();
16 |
17 | virtual void b();
18 | // CHECK-FIXES: {{^}} virtual void b();
19 | };
20 |
--------------------------------------------------------------------------------
/test/clang-tidy/modernize-use-override-no-destructors.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s modernize-use-override %t -- \
2 | // RUN: -config="{CheckOptions: [{key: modernize-use-override.IgnoreDestructors, value: 1}]}"
3 |
4 | struct Base {
5 | virtual ~Base();
6 | virtual void f();
7 | };
8 |
9 | struct Simple : public Base {
10 | virtual ~Simple();
11 | // CHECK-MESSAGES-NOT: warning:
12 | virtual void f();
13 | // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: prefer using
14 | // CHECK-FIXES: {{^}} void f() override;
15 | };
16 |
--------------------------------------------------------------------------------
/test/clang-tidy/nonstandard-file-extension.test:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -assume-filename=const-cast.cpp %s cppcoreguidelines-pro-type-const-cast %t
2 |
3 | const int *i;
4 | int *j;
5 | void f() { j = const_cast(i); }
6 | // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]
7 |
--------------------------------------------------------------------------------
/test/clang-tidy/objc-avoid-nserror-init.m:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s objc-avoid-nserror-init %t
2 | @interface NSError
3 | + (instancetype)alloc;
4 | - (instancetype)init;
5 | @end
6 |
7 | @implementation foo
8 | - (void)bar {
9 | NSError *error = [[NSError alloc] init];
10 | // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: use errorWithDomain:code:userInfo: or initWithDomain:code:userInfo: to create a new NSError [objc-avoid-nserror-init]
11 | }
12 | @end
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/overlapping.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \
2 | // RUN: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \
3 | // RUN: not grep "note: this fix will not be applied because it overlaps with another fix"
4 |
5 | #include
6 | #include "o.h"
7 |
8 | // Test that clang-tidy takes into account in which file we are doing the
9 | // replacements to determine if they overlap or not. In the file "o.h" there is
10 | // a similar error at the same file offset, but they do not overlap.
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/performance-unnecessary-value-param-arc.m:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,performance-unnecessary-value-param -- \
2 | // RUN: -xobjective-c -fobjc-abi-version=2 -fobjc-arc | count 0
3 |
4 | #if !__has_feature(objc_arc)
5 | #error Objective-C ARC not enabled as expected
6 | #endif
7 |
8 | // Passing an Objective-C ARC-managed object to a C function should
9 | // not raise performance-unnecessary-value-param.
10 | void foo(id object) { }
11 |
12 | // Same for explcitly non-ARC-managed Objective-C objects.
13 | void bar(__unsafe_unretained id object) { }
14 |
15 | // Same for Objective-c classes.
16 | void baz(Class c) { }
17 |
--------------------------------------------------------------------------------
/test/clang-tidy/performance-unnecessary-value-param-arc.mm:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks=-*,performance-unnecessary-value-param -- \
2 | // RUN: -xobjective-c++ -fobjc-abi-version=2 -fobjc-arc | count 0
3 |
4 | #if !__has_feature(objc_arc)
5 | #error Objective-C ARC not enabled as expected
6 | #endif
7 |
8 | // Passing an Objective-C ARC-managed object to a C function should
9 | // not raise performance-unnecessary-value-param.
10 | void foo(id object) { }
11 |
12 | // Same for explcitly non-ARC-managed Objective-C objects.
13 | void bar(__unsafe_unretained id object) { }
14 |
15 | // Same for Objective-c classes.
16 | void baz(Class c) { }
17 |
--------------------------------------------------------------------------------
/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors
2 |
3 | // Ensure that incomplete types result in an error from the frontend and not a
4 | // clang-tidy diagnostic about IncompleteType being expensive to copy.
5 | struct IncompleteType;
6 | void NegativeForIncompleteType(IncompleteType I) {
7 | // CHECK-MESSAGES: [[@LINE-1]]:47: error: variable has incomplete type 'IncompleteType' [clang-diagnostic-error]
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/test/clang-tidy/portability-simd-intrinsics-ppc.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \
2 | // RUN: -config='{CheckOptions: [ \
3 | // RUN: {key: portability-simd-intrinsics.Suggest, value: 1} \
4 | // RUN: ]}' -- -target ppc64le -maltivec
5 | // FIXME: Fix the checker to work in C++2a mode.
6 |
7 | vector int vec_add(vector int, vector int);
8 |
9 | void PPC() {
10 | vector int i0, i1;
11 |
12 | vec_add(i0, i1);
13 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'vec_add' can be replaced by operator+ on std::experimental::simd objects [portability-simd-intrinsics]
14 | }
15 |
--------------------------------------------------------------------------------
/test/clang-tidy/pr37091.cpp:
--------------------------------------------------------------------------------
1 | // REQUIRES: shell
2 | // RUN: rm -rf %t
3 | // RUN: mkdir -p %t
4 |
5 | // This is a reproducer for PR37091.
6 | //
7 | // Verify that no temporary files are left behind by the clang-tidy invocation.
8 |
9 | // RUN: env TMPDIR=%t TEMP=%t TMP=%t clang-tidy %s -- --target=mips64
10 | // RUN: rmdir %t
11 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-braces-around-statements-assert-failure.cpp:
--------------------------------------------------------------------------------
1 | // RUN: not clang-tidy -checks='-*,readability-braces-around-statements' %s --
2 |
3 | // Note: this test expects no assert failure happened in clang-tidy.
4 |
5 | int test_failure() {
6 | if (std::rand()) {
7 | }
8 | }
9 |
10 | void test_failure2() {
11 | for (a b c;;
12 | }
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-else-after-return-if-constexpr.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++17
2 |
3 | // Constexpr if is an exception to the rule, we cannot remove the else.
4 | void f() {
5 | if (sizeof(int) > 4)
6 | return;
7 | else
8 | return;
9 | // CHECK-MESSAGES: [[@LINE-2]]:3: warning: do not use 'else' after 'return'
10 |
11 | if constexpr (sizeof(int) > 4)
12 | return;
13 | else
14 | return;
15 |
16 | if constexpr (sizeof(int) > 4)
17 | return;
18 | else if constexpr (sizeof(long) > 4)
19 | return;
20 | else
21 | return;
22 | }
23 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-identifier-naming-bugfix.cpp:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy -expect-clang-tidy-error %s readability-identifier-naming %t
2 |
3 | // This used to cause a null pointer dereference.
4 | auto [left] = right;
5 | // CHECK-MESSAGES: :[[@LINE-1]]:15: error: use of undeclared identifier 'right'
6 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-identifier-naming-objc.m:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s readability-identifier-naming %t \
2 | // RUN: -config='{CheckOptions: \
3 | // RUN: [{key: readability-identifier-naming.ObjcIvarPrefix, value: '_'}]}' \
4 | // RUN: --
5 |
6 | @interface Foo {
7 | int _bar;
8 | int barWithoutPrefix;
9 | // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for objc ivar 'barWithoutPrefix' [readability-identifier-naming]
10 | // CHECK-FIXES: int _barWithoutPrefix;
11 | }
12 | @end
13 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-isolate-declaration.c:
--------------------------------------------------------------------------------
1 | // RUN: %check_clang_tidy %s readability-isolate-declaration %t
2 |
3 | void c_specific() {
4 | void (*signal(int sig, void (*func)(int)))(int);
5 | int i = sizeof(struct S { int i; });
6 | int j = sizeof(struct T { int i; }), k;
7 | // CHECK-MESSAGES: [[@LINE-1]]:3: warning: multiple declarations in a single statement reduces readability
8 | // CHECK-FIXES: int j = sizeof(struct T { int i; });
9 | // CHECK-FIXES: {{^ }}int k;
10 |
11 | void g(struct U { int i; } s); // One decl
12 | void h(struct V { int i; } s), m(int i, ...); // Two decls
13 | }
14 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-redundant-preprocessor.h:
--------------------------------------------------------------------------------
1 | #ifndef FOO
2 | #ifndef FOO // this would warn, but not in a header
3 | void f();
4 | #endif
5 | #endif
6 |
--------------------------------------------------------------------------------
/test/clang-tidy/readability-uppercase-literal-suffix.h:
--------------------------------------------------------------------------------
1 | template
2 | struct integral_constant {
3 | static constexpr T value = v;
4 | typedef T value_type;
5 | typedef integral_constant type; // using injected-class-name
6 | constexpr operator value_type() const noexcept { return value; }
7 | };
8 |
9 | using false_type = integral_constant;
10 | using true_type = integral_constant;
11 |
12 | template
13 | struct is_same : false_type {};
14 |
15 | template
16 | struct is_same : true_type {};
17 |
--------------------------------------------------------------------------------
/test/clang-tidy/select-checks.cpp:
--------------------------------------------------------------------------------
1 | // RUN: clang-tidy %s -checks='-*,llvm-namespace-*' -- 2>&1 | FileCheck -implicit-check-not='{{warning:|error:}}' %s
2 | // RUN: not clang-tidy %s -checks='-*,an-unknown-check' -- 2>&1 | FileCheck -implicit-check-not='{{warning:|error:}}' -check-prefix=CHECK2 %s
3 |
4 | // CHECK2: Error: no checks enabled.
5 |
6 | namespace i {
7 | }
8 | // CHECK: :[[@LINE-1]]:2: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment]
9 |
10 | // Expect no warnings from the google-explicit-constructor check:
11 | class A { A(int i); };
12 |
--------------------------------------------------------------------------------
/test/clang-tidy/serialize-diagnostics.cpp:
--------------------------------------------------------------------------------
1 | // RUN: not clang-tidy -checks=-*,llvm-namespace-comment %s -- -serialize-diagnostics %t | FileCheck %s
2 | // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error]
3 | struct A {}
4 |
--------------------------------------------------------------------------------
/test/clang-tidy/static-analyzer.cpp:
--------------------------------------------------------------------------------
1 | // REQUIRES: static-analyzer
2 | // RUN: clang-tidy %s -checks='-*,clang-analyzer-*' -- | FileCheck %s
3 | extern void *malloc(unsigned long);
4 | extern void free(void *);
5 |
6 | void f() {
7 | int *p = new int(42);
8 | delete p;
9 | delete p;
10 | // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete]
11 | }
12 |
13 | void g() {
14 | void *q = malloc(132);
15 | free(q);
16 | free(q);
17 | // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
18 | }
19 |
--------------------------------------------------------------------------------
/test/clang-tidy/validate-check-names.cpp:
--------------------------------------------------------------------------------
1 | // Check names may only contain alphanumeric characters, '-', '_', and '.'.
2 | // RUN: clang-tidy -checks=* -list-checks | grep '^ ' | cut -b5- | not grep -v '^[a-zA-Z0-9_.\-]\+$'
3 |
--------------------------------------------------------------------------------
/test/clang-tidy/vfsoverlay.cpp:
--------------------------------------------------------------------------------
1 | // RUN: sed -e "s:INPUT_DIR:%S/Inputs/vfsoverlay:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay/vfsoverlay.yaml > %t.yaml
2 | // RUN: clang-tidy %s -checks='-*,modernize-use-nullptr' -vfsoverlay %t.yaml -- -I %t | FileCheck %s
3 | // REQUIRES: shell
4 |
5 | #include "not_real.h"
6 |
7 | X *ptr = 0;
8 | // CHECK: warning: use nullptr [modernize-use-nullptr]
9 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/Anonymous.h:
--------------------------------------------------------------------------------
1 | // Exercise some anonymous type issues.
2 |
3 | // Anonymous enum.
4 | enum {
5 | Tag1
6 | };
7 |
8 | // Anonymous enum typedef.
9 | typedef enum {
10 | Tag2
11 | } AnonymousEnum;
12 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CompileError/HasError.h:
--------------------------------------------------------------------------------
1 | typedef WithoutDep BadType;
2 |
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CompileError/Level1A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_1A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CompileError/module.modulemap:
--------------------------------------------------------------------------------
1 | // module.map
2 |
3 | module Level1A {
4 | header "Level1A.h"
5 | export *
6 | }
7 | module HasError {
8 | header "HasError.h"
9 | export *
10 | }
11 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageNoProblems/Includes1/.hidden/DontFindMe.h:
--------------------------------------------------------------------------------
1 | #error DontFindMe.h shouldn't be found.
2 |
3 |
4 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageNoProblems/Includes1/Level1A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_1A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageNoProblems/Includes2/Level2A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_2A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageNoProblems/NonIncludes/Level3A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_3A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageNoProblems/module.modulemap:
--------------------------------------------------------------------------------
1 | // module.map
2 |
3 | module Level1A {
4 | header "Includes1/Level1A.h"
5 | export *
6 | }
7 | module Level2A {
8 | header "Includes2/Level2A.h"
9 | export *
10 | }
11 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level1A.h:
--------------------------------------------------------------------------------
1 | #include "Level2A.h"
2 | #define MACRO_1A 1
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level1B.h:
--------------------------------------------------------------------------------
1 | #include "Level2B.h"
2 | #define MACRO_1B 1
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level2A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_2A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level2B.h:
--------------------------------------------------------------------------------
1 | #define MACRO_2B 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level3A.h:
--------------------------------------------------------------------------------
1 | #include "Sub/Level3B.h"
2 | #define MACRO_3A 1
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Level3B:
--------------------------------------------------------------------------------
1 | #define MACRO_3B 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/Sub/Level3B.h:
--------------------------------------------------------------------------------
1 | #define MACRO_3B 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/UmbrellaFile.h:
--------------------------------------------------------------------------------
1 | #define UMBRELLA_HEADER 1
2 | #include "UmbrellaInclude1.h"
3 | #include "UmbrellaInclude2.h"
4 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/UmbrellaInclude1.h:
--------------------------------------------------------------------------------
1 | #define UMBRELLA_INCLUDE_1 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/UmbrellaInclude2.h:
--------------------------------------------------------------------------------
1 | #define UMBRELLA_INCLUDE_2 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/UmbrellaSub/Umbrell1.h:
--------------------------------------------------------------------------------
1 | #define UMBRELLA_1 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/UmbrellaSub/Umbrell2.h:
--------------------------------------------------------------------------------
1 | #define UMBRELLA_2 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/CoverageProblems/module.modulemap:
--------------------------------------------------------------------------------
1 | // module.map
2 |
3 | module Level1A {
4 | header "Level1A.h"
5 | export *
6 | }
7 | module Level1B {
8 | header "Level1B.h"
9 | export *
10 | module Level2B {
11 | header "Level2B.h"
12 | export *
13 | }
14 | }
15 | module Level2A {
16 | header "Level2A.h"
17 | export *
18 | }
19 | module UmbrellaDirectoryModule {
20 | umbrella "UmbrellaSub"
21 | }
22 | module UmbrellaHeaderModule {
23 | umbrella header "UmbrellaFile.h"
24 | }
25 | /*
26 | module NoHeader {
27 | header "NoHeader.h"
28 | export *
29 | }
30 | */
31 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/DuplicateHeader1.h:
--------------------------------------------------------------------------------
1 | // Same decl as in DuplicateHeader2.h.
2 | typedef int TypeInt;
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/DuplicateHeader2.h:
--------------------------------------------------------------------------------
1 | // Same decl as in DuplicateHeader1.h.
2 | typedef int TypeInt;
3 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/Empty.h:
--------------------------------------------------------------------------------
1 | // Empty header for testing #include directives in blocks.
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/HeaderGuard.h:
--------------------------------------------------------------------------------
1 | #ifndef _HEADERGUARD_H_
2 | #define _HEADERGUARD_H_
3 | #include "HeaderGuardSub1.h"
4 | #include "HeaderGuardSub2.h"
5 | #include "HeaderGuardSubSub.h"
6 | #endif // _HEADERGUARD_H_
7 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/HeaderGuardSub1.h:
--------------------------------------------------------------------------------
1 | #ifndef _HEADERGUARDSUB1_H_
2 | #define _HEADERGUARDSUB1_H_
3 | #include "HeaderGuardSubSub.h"
4 | #include "HeaderGuardSubSubDefined.h"
5 | #endif // _HEADERGUARDSUB1_H_
6 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/HeaderGuardSub2.h:
--------------------------------------------------------------------------------
1 | #ifndef _HEADERGUARDSUB2_H_
2 | #define _HEADERGUARDSUB2_H_
3 | #include "HeaderGuardSubSub.h"
4 | #include "HeaderGuardSubSubDefined.h"
5 | #endif // _HEADERGUARDSUB2_H_
6 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/HeaderGuardSubSub.h:
--------------------------------------------------------------------------------
1 | #ifndef _HEADERGUARDSUBSUB_H_
2 | #define _HEADERGUARDSUBSUB_H_
3 |
4 | #define SOMETHING 1
5 |
6 | // Nest include. Header guard should not confuse modularize.
7 | #include "HeaderGuard.h"
8 |
9 | #endif // _HEADERGUARDSUBSUB_H_
10 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/HeaderGuardSubSubDefined.h:
--------------------------------------------------------------------------------
1 | #if !defined(_HEADERGUARDSUBSUBDEFINED_H_)
2 | #define _HEADERGUARDSUBSUBDEFINED_H_
3 |
4 | #define SOMETHING_OTHER 1
5 |
6 | // Nest include. Header guard should not confuse modularize.
7 | #include "HeaderGuard.h"
8 |
9 | #endif // _HEADERGUARDSUBSUBDEFINED_H_
10 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/IncludeInExtern.h:
--------------------------------------------------------------------------------
1 | extern "C" {
2 | #include "Empty.h"
3 | }
4 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/IncludeInNamespace.h:
--------------------------------------------------------------------------------
1 | namespace MyNamespace {
2 | #include "Empty.h"
3 | }
4 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/InconsistentHeader1.h:
--------------------------------------------------------------------------------
1 | // Define symbol such that a declaration exists when this header
2 | // is included, but not when InconsistentHeader2.h is included.
3 | #define SYMBOL1 1
4 | #include "InconsistentSubHeader.h"
5 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/InconsistentHeader2.h:
--------------------------------------------------------------------------------
1 | // Set up so the declaration in InconsistentSubHeader.h is not defined.
2 | #define SYMBOL2 1
3 | #include "InconsistentSubHeader.h"
4 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/InconsistentSubHeader.h:
--------------------------------------------------------------------------------
1 | // Set up so TypeInt only defined during InconsistentHeader1.h include.
2 | #ifdef SYMBOL1
3 | #define SYMBOL 1
4 | #define FUNC_STYLE(a, b) a||b
5 | #endif
6 | #ifdef SYMBOL2
7 | #define SYMBOL 2
8 | #define FUNC_STYLE(a, b) a&&b
9 | #endif
10 |
11 | #if SYMBOL == 1
12 | typedef int TypeInt;
13 | #endif
14 |
15 | int var = FUNC_STYLE(1, 0);
16 |
17 | #if defined(SYMBOL1)
18 | #endif
19 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/IsDependent.h:
--------------------------------------------------------------------------------
1 | // This header depends on SomeTypes.h for the TypeInt typedef.
2 |
3 | typedef TypeInt NewTypeInt;
4 | typedef OtherTypeInt OtherNewTypeInt;
5 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/MissingHeader/Level1A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_1A 1
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/MissingHeader/module.modulemap:
--------------------------------------------------------------------------------
1 | // module.map
2 |
3 | module Level1A {
4 | header "Level1A.h"
5 | export *
6 | }
7 | module Missing {
8 | header "Missing.h"
9 | export *
10 | }
11 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/NamespaceClasses.h:
--------------------------------------------------------------------------------
1 | // Define same class name in different namespaces.
2 |
3 | namespace Namespace1 {
4 | class NamespaceClass {
5 | public:
6 | NamespaceClass() : Member(0) {}
7 | private:
8 | int Member;
9 | };
10 | }
11 |
12 | namespace Namespace2 {
13 | class NamespaceClass {
14 | public:
15 | NamespaceClass() : Member(0) {}
16 | private:
17 | int Member;
18 | };
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/NestedMacro.h:
--------------------------------------------------------------------------------
1 | // Verification of fix for nested macro.
2 |
3 | #define FUNCMACROINNER(a) a
4 | #define FUNCMACROOUTER(b, c) FUNCMACROINNER(b) + FUNCMACROINNER(c)
5 | int FuncMacroValue = FUNCMACROOUTER(1, 2);
6 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/NoProblems.modulemap:
--------------------------------------------------------------------------------
1 | // NoProblems.modulemap
2 | module SomeTypes {
3 | header "SomeTypes.h"
4 | export *
5 | }
6 | module SomeDecls {
7 | header "SomeDecls.h"
8 | export *
9 | }
10 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/ProblemsDuplicate.modulemap:
--------------------------------------------------------------------------------
1 | // ProblemsDuplicate.modulemap
2 | module DuplicateHeader1 {
3 | header "DuplicateHeader1.h"
4 | export *
5 | }
6 | module DuplicateHeader2 {
7 | header "DuplicateHeader2.h"
8 | export *
9 | }
10 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SomeDecls.h:
--------------------------------------------------------------------------------
1 | // Declare a couple of functions - no modules problems.
2 |
3 | void FuncOne();
4 |
5 | int FuncTwo(int arg);
6 |
7 | void FuncOverload(int arg) {}
8 | void FuncOverload(char *arg) {}
9 |
10 | namespace Namespace1 {
11 | void FuncNameSpace() {}
12 | }
13 |
14 | namespace Namespace2 {
15 | void FuncNameSpace() {}
16 | }
17 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SomeOtherTypes.h:
--------------------------------------------------------------------------------
1 | // Declare another type for the dependency check.
2 | // This file dependent on SomeTypes.h being included first.
3 |
4 | typedef TypeInt OtherTypeInt;
5 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SomeTypes.h:
--------------------------------------------------------------------------------
1 | // Define a few different kinds of types - no modules problems.
2 |
3 | typedef int TypeInt;
4 |
5 | typedef TypeInt NestedTypeInt;
6 |
7 | struct TypeStruct {
8 | int Member;
9 | };
10 |
11 | class TypeClass {
12 | public:
13 | TypeClass() : Member(0) {}
14 | private:
15 | int Member;
16 | };
17 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SubModule1/Header1.h:
--------------------------------------------------------------------------------
1 | // Header1.h - Empty.
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SubModule1/Header2.h:
--------------------------------------------------------------------------------
1 | // Header2.h - Empty.
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SubModule2/Header3.h:
--------------------------------------------------------------------------------
1 | // Header3.h - Empty.
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/SubModule2/Header4.h:
--------------------------------------------------------------------------------
1 | // Header4.h - Empty.
2 |
--------------------------------------------------------------------------------
/test/modularize/Inputs/TemplateClasses.h:
--------------------------------------------------------------------------------
1 | // Exercise some template issues. Should not produce errors.
2 |
3 | // Forward declaration.
4 | template class TemplateClass;
5 |
6 | // Full declaration.
7 | templateclass TemplateClass {
8 | public:
9 | TemplateClass() {}
10 | private:
11 | T Member;
12 | };
13 |
14 | // Template alias.
15 | template using TemplateClassAlias = TemplateClass;
16 |
--------------------------------------------------------------------------------
/test/modularize/NoProblems.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 | # RUN: modularize -prefix=%p %s -x c++
3 | # RUN: modularize -no-coverage-check %S/Inputs/NoProblems.modulemap -x c++
4 |
5 | Inputs/SomeTypes.h
6 | Inputs/SomeDecls.h
7 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsAnonymous.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/Anonymous.h
4 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsCoverage.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize -I Includes1 -I Includes2 %S/Inputs/CoverageNoProblems/module.modulemap
2 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsDependencies.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/IsDependent.h: Inputs/SomeTypes.h Inputs/SomeOtherTypes.h
4 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsGuard.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/HeaderGuardSub1.h
4 | Inputs/HeaderGuardSub2.h
5 | Inputs/HeaderGuard.h
6 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsList.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %S/NoProblems.modularize,%S/NoProblemsAnonymous.modularize -x c++
2 | # RUN: modularize -prefix=%p %S/NoProblems.modularize,%S/NoProblemsAnonymous.modularize -x c++
3 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsNamespace.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize -block-check-header-list-only %s
2 |
3 | Inputs/IncludeInNamespace.h
4 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsNamespaceClasses.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/NamespaceClasses.h
4 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsNestedMacro.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/NestedMacro.h
4 |
--------------------------------------------------------------------------------
/test/modularize/NoProblemsTemplateClasses.modularize:
--------------------------------------------------------------------------------
1 | # RUN: modularize %s -x c++
2 |
3 | Inputs/TemplateClasses.h
4 |
--------------------------------------------------------------------------------
/test/modularize/ProblemsCompileError.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %S/Inputs/CompileError/module.modulemap 2>&1 | FileCheck %s
2 |
3 | # CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}CompileError{{[/\\]}}HasError.h:1:9: error: unknown type name 'WithoutDep'
4 |
--------------------------------------------------------------------------------
/test/modularize/ProblemsCoverage.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %S/Inputs/CoverageProblems/module.modulemap 2>&1 | FileCheck %s
2 |
3 | # CHECK: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Level3A.h
4 | # CHECK-NEXT: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Level3B
5 | # CHECK-NEXT: warning: {{.*}}{{[/\\]}}Inputs/CoverageProblems/module.modulemap does not account for file: {{.*}}{{[/\\]}}Inputs/CoverageProblems/Sub/Level3B.h
6 |
--------------------------------------------------------------------------------
/test/modularize/ProblemsDuplicate.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %s -x c++ 2>&1 | FileCheck %s
2 | # RUN: not modularize %S/Inputs/ProblemsDuplicate.modulemap -x c++ 2>&1 | FileCheck %s
3 |
4 | Inputs/DuplicateHeader1.h
5 | Inputs/DuplicateHeader2.h
6 |
7 | # CHECK: error: value 'TypeInt' defined at multiple locations:
8 | # CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}DuplicateHeader1.h:2:13
9 | # CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}DuplicateHeader2.h:2:13
--------------------------------------------------------------------------------
/test/modularize/ProblemsExternC.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %s -x c++ 2>&1 | FileCheck %s
2 |
3 | Inputs/IncludeInExtern.h
4 |
5 | # CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}IncludeInExtern.h:2:3:
6 | # CHECK-NEXT: #include "Empty.h"
7 | # CHECK-NEXT: ^
8 | # CHECK-NEXT: error: Include directive within extern "C" {}.
9 | # CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}IncludeInExtern.h:1:1:
10 | # CHECK-NEXT: extern "C" {
11 | # CHECK-NEXT: ^
12 | # CHECK-NEXT: The "extern "C" {}" block is here.
13 |
--------------------------------------------------------------------------------
/test/modularize/ProblemsMissingHeader.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %S/Inputs/MissingHeader/module.modulemap 2>&1 | FileCheck %s
2 |
3 | # CHECK: {{.*}}{{[/\\]}}Inputs/MissingHeader/module.modulemap:8:10: error : Header not found: Missing.h
4 |
--------------------------------------------------------------------------------
/test/modularize/ProblemsNamespace.modularize:
--------------------------------------------------------------------------------
1 | # RUN: not modularize %s -x c++ 2>&1 | FileCheck %s
2 |
3 | Inputs/IncludeInNamespace.h
4 |
5 | # CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}IncludeInNamespace.h:2:3:
6 | # CHECK-NEXT: #include "Empty.h"
7 | # CHECK-NEXT: ^
8 | # CHECK-NEXT: error: Include directive within namespace MyNamespace {}.
9 | # CHECK-NEXT: {{.*}}{{[/\\]}}Inputs{{[/\\]}}IncludeInNamespace.h:1:1:
10 | # CHECK-NEXT: namespace MyNamespace {
11 | # CHECK-NEXT: ^
12 | # CHECK-NEXT: The "namespace MyNamespace {}" block is here.
13 |
--------------------------------------------------------------------------------
/test/modularize/SubModule2.h:
--------------------------------------------------------------------------------
1 | // SubModule2.h - Master header with same name as directory.
2 | #include "SubModule2/Header3.h"
3 | #include "SubModule2/Header4.h"
4 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/Level1A.h:
--------------------------------------------------------------------------------
1 | #include "Level2A.h"
2 | #define MACRO_1A 1
3 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/Level1B.h:
--------------------------------------------------------------------------------
1 | #include "Level2B.h"
2 | #define MACRO_1B 1
3 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/Level2A.h:
--------------------------------------------------------------------------------
1 | #define MACRO_2A 1
2 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/Level2B.h:
--------------------------------------------------------------------------------
1 | #define MACRO_2B 1
2 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/ModularizeList.txt:
--------------------------------------------------------------------------------
1 | Level1A.h
2 | Level1B.h
3 | Level2A.h
4 | Level2B.h
5 |
--------------------------------------------------------------------------------
/test/pp-trace/Inputs/module.map:
--------------------------------------------------------------------------------
1 | // module.map
2 |
3 | module Level1A {
4 | header "Level1A.h"
5 | export *
6 | }
7 | module Level1B {
8 | header "Level1B.h"
9 | export *
10 | module Level2B {
11 | header "Level2B.h"
12 | export *
13 | }
14 | }
15 | module Level2A {
16 | header "Level2A.h"
17 | export *
18 | }
19 |
--------------------------------------------------------------------------------
/test/pp-trace/pp-trace-ident.cpp:
--------------------------------------------------------------------------------
1 | // RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -- -undef -target x86_64 -std=c++11 | FileCheck --strict-whitespace %s
2 |
3 | #ident "$Id$"
4 |
5 | // CHECK: ---
6 | // CHECK-NEXT: - Callback: Ident
7 | // CHECK-NEXT: Loc: "{{.*}}{{[/\\]}}pp-trace-ident.cpp:3:2"
8 | // CHECK-NEXT: Str: "$Id$"
9 | // CHECK-NEXT: - Callback: EndOfMainFile
10 | // CHECK-NEXT: ...
11 |
--------------------------------------------------------------------------------
/tool-template/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | Support
3 | )
4 |
5 | add_clang_executable(tool-template
6 | ToolTemplate.cpp
7 | )
8 |
9 | target_link_libraries(tool-template
10 | PRIVATE
11 | clangAST
12 | clangASTMatchers
13 | clangBasic
14 | clangFrontend
15 | clangTooling
16 | clangToolingRefactoring
17 | )
18 |
--------------------------------------------------------------------------------
/unittests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_custom_target(ExtraToolsUnitTests)
2 | set_target_properties(ExtraToolsUnitTests PROPERTIES FOLDER "Extra Tools Unit Tests")
3 |
4 | function(add_extra_unittest test_dirname)
5 | add_unittest(ExtraToolsUnitTests ${test_dirname} ${ARGN})
6 | endfunction()
7 |
8 | add_subdirectory(clang-apply-replacements)
9 | add_subdirectory(clang-change-namespace)
10 | add_subdirectory(clang-doc)
11 | add_subdirectory(clang-include-fixer)
12 | add_subdirectory(clang-move)
13 | add_subdirectory(clang-query)
14 | add_subdirectory(clang-tidy)
15 |
--------------------------------------------------------------------------------
/unittests/clang-include-fixer/find-all-symbols/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | get_filename_component(INCLUDE_FIXER_SOURCE_DIR
6 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../clang-include-fixer/find-all-symbols REALPATH)
7 | include_directories(
8 | ${INCLUDE_FIXER_SOURCE_DIR}
9 | )
10 |
11 | add_extra_unittest(FindAllSymbolsTests
12 | FindAllSymbolsTests.cpp
13 | )
14 |
15 | target_link_libraries(FindAllSymbolsTests
16 | PRIVATE
17 | clangAST
18 | clangASTMatchers
19 | clangBasic
20 | clangFrontend
21 | clangLex
22 | clangSerialization
23 | clangTooling
24 | findAllSymbols
25 | )
26 |
--------------------------------------------------------------------------------
/unittests/clang-query/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(LLVM_LINK_COMPONENTS
2 | support
3 | )
4 |
5 | include_directories(
6 | ${CMAKE_CURRENT_SOURCE_DIR}/../../clang-query
7 | )
8 |
9 | add_extra_unittest(ClangQueryTests
10 | QueryEngineTest.cpp
11 | QueryParserTest.cpp
12 | )
13 |
14 | target_link_libraries(ClangQueryTests
15 | PRIVATE
16 | clangAST
17 | clangASTMatchers
18 | clangBasic
19 | clangDynamicASTMatchers
20 | clangFrontend
21 | clangQuery
22 | clangSerialization
23 | clangTooling
24 | )
25 |
--------------------------------------------------------------------------------