#include "ASTMatchersTest.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/TargetParser/Host.h"
#include "llvm/TargetParser/Triple.h"
#include "gtest/gtest.h"
namespace clang {
namespace ast_matchers {
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesInFile) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesNested) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesIntermediate) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesTransitive) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesArgument) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesArgumentMacroExpansion) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesWhenInArgument) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_MatchesObjectMacro) { … }
TEST(IsExpandedFromMacro, MatchesFromCommandLine) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_NotMatchesBeginOnly) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_NotMatchesEndOnly) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_NotMatchesDifferentMacro) { … }
TEST_P(ASTMatchersTest, IsExpandedFromMacro_NotMatchesDifferentInstances) { … }
TEST(IsExpandedFromMacro, IsExpandedFromMacro_MatchesDecls) { … }
TEST(IsExpandedFromMacro, IsExpandedFromMacro_MatchesTypelocs) { … }
TEST_P(ASTMatchersTest, AllOf) { … }
TEST_P(ASTMatchersTest, Has) { … }
TEST_P(ASTMatchersTest, Has_RecursiveAllOf) { … }
TEST_P(ASTMatchersTest, Has_RecursiveAnyOf) { … }
TEST_P(ASTMatchersTest, Unless) { … }
TEST_P(ASTMatchersTest, HasCastKind) { … }
TEST_P(ASTMatchersTest, HasDescendant) { … }
TEST_P(ASTMatchersTest, HasDescendant_Memoization) { … }
TEST_P(ASTMatchersTest, HasDescendant_MemoizationUsesRestrictKind) { … }
TEST_P(ASTMatchersTest, HasAncestor_Memoization) { … }
TEST_P(ASTMatchersTest, HasAttr) { … }
TEST_P(ASTMatchersTest, AnyOf) { … }
TEST_P(ASTMatchersTest, MapAnyOf) { … }
TEST_P(ASTMatchersTest, IsDerivedFrom) { … }
TEST_P(ASTMatchersTest, IsDerivedFrom_EmptyName) { … }
TEST_P(ASTMatchersTest, IsDerivedFrom_ObjC) { … }
TEST_P(ASTMatchersTest, IsLambda) { … }
TEST_P(ASTMatchersTest, Bind) { … }
TEST_P(ASTMatchersTest, Bind_SameNameInAlternatives) { … }
TEST_P(ASTMatchersTest, Bind_BindsIDForMemoizedResults) { … }
TEST_P(ASTMatchersTest, HasType_MatchesAsString) { … }
TEST_P(ASTMatchersTest, HasOverloadedOperatorName) { … }
TEST_P(ASTMatchersTest, HasOverloadedOperatorName_MatchesNestedCalls) { … }
TEST_P(ASTMatchersTest, HasLocalStorage) { … }
TEST_P(ASTMatchersTest, HasGlobalStorage) { … }
TEST_P(ASTMatchersTest, IsStaticLocal) { … }
TEST_P(ASTMatchersTest, IsInitCapture) { … }
TEST_P(ASTMatchersTest, StorageDuration) { … }
TEST_P(ASTMatchersTest, VarDecl_MatchesFunctionParameter) { … }
TEST_P(ASTMatchersTest, SizeOfExpr_MatchesCorrectType) { … }
TEST_P(ASTMatchersTest, IsInteger_MatchesIntegers) { … }
TEST_P(ASTMatchersTest, IsInteger_ReportsNoFalsePositives) { … }
TEST_P(ASTMatchersTest, IsSignedInteger_MatchesSignedIntegers) { … }
TEST_P(ASTMatchersTest, IsUnsignedInteger_MatchesUnsignedIntegers) { … }
TEST_P(ASTMatchersTest, IsAnyPointer_MatchesPointers) { … }
TEST_P(ASTMatchersTest, IsAnyPointer_MatchesObjcPointer) { … }
TEST_P(ASTMatchersTest, IsAnyPointer_ReportsNoFalsePositives) { … }
TEST_P(ASTMatchersTest, IsAnyCharacter_MatchesCharacters) { … }
TEST_P(ASTMatchersTest, IsAnyCharacter_ReportsNoFalsePositives) { … }
TEST_P(ASTMatchersTest, IsArrow_MatchesMemberVariablesViaArrow) { … }
TEST_P(ASTMatchersTest, IsArrow_MatchesStaticMemberVariablesViaArrow) { … }
TEST_P(ASTMatchersTest, IsArrow_MatchesMemberCallsViaArrow) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXConversionDecl) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXConversionDecl_CXX20) { … }
TEST_P(ASTMatchersTest, ArgumentCountAtLeast_CallExpr) { … }
TEST_P(ASTMatchersTest, ArgumentCountAtLeast_CallExpr_CXX) { … }
TEST_P(ASTMatchersTest, ArgumentCountIs_CallExpr) { … }
TEST_P(ASTMatchersTest, ArgumentCountIs_CallExpr_CXX) { … }
TEST_P(ASTMatchersTest, ParameterCountIs) { … }
TEST_P(ASTMatchersTest, ParameterCountIs_CXX) { … }
TEST_P(ASTMatchersTest, References) { … }
TEST_P(ASTMatchersTest, HasLocalQualifiers) { … }
TEST_P(ASTMatchersTest, IsExternC_MatchesExternCFunctionDeclarations) { … }
TEST_P(ASTMatchersTest, IsExternC_MatchesExternCVariableDeclarations) { … }
TEST_P(ASTMatchersTest, IsStaticStorageClass) { … }
TEST_P(ASTMatchersTest, IsDefaulted) { … }
TEST_P(ASTMatchersTest, IsDeleted) { … }
TEST_P(ASTMatchersTest, IsNoThrow_DynamicExceptionSpec) { … }
TEST_P(ASTMatchersTest, IsNoThrow_CXX11) { … }
TEST_P(ASTMatchersTest, IsConsteval) { … }
TEST_P(ASTMatchersTest, IsConsteval_MatchesIfConsteval) { … }
TEST_P(ASTMatchersTest, IsConstexpr) { … }
TEST_P(ASTMatchersTest, IsConstexpr_MatchesIfConstexpr) { … }
TEST_P(ASTMatchersTest, IsConstinit) { … }
TEST_P(ASTMatchersTest, HasInitStatement_MatchesSelectionInitializers) { … }
TEST_P(ASTMatchersTest, HasInitStatement_MatchesSelectionInitializers_CXX) { … }
TEST_P(ASTMatchersTest, HasInitStatement_MatchesSelectionInitializers_CXX17) { … }
TEST_P(ASTMatchersTest, HasInitStatement_MatchesRangeForInitializers) { … }
TEST_P(ASTMatchersTest, TemplateArgumentCountIs) { … }
TEST_P(ASTMatchersTest, IsIntegral) { … }
TEST_P(ASTMatchersTest, EqualsIntegralValue) { … }
TEST_P(ASTMatchersTest, AccessSpecDecl) { … }
TEST_P(ASTMatchersTest, IsFinal) { … }
TEST_P(ASTMatchersTest, IsVirtual) { … }
TEST_P(ASTMatchersTest, IsVirtualAsWritten) { … }
TEST_P(ASTMatchersTest, IsPure) { … }
TEST_P(ASTMatchersTest, IsExplicitObjectMemberFunction) { … }
TEST_P(ASTMatchersTest, IsCopyAssignmentOperator) { … }
TEST_P(ASTMatchersTest, IsMoveAssignmentOperator) { … }
TEST_P(ASTMatchersTest, IsConst) { … }
TEST_P(ASTMatchersTest, IsOverride) { … }
TEST_P(ASTMatchersTest, HasArgument_CXXConstructorDecl) { … }
TEST_P(ASTMatchersTest, ArgumentCountIs_CXXConstructExpr) { … }
TEST(ASTMatchersTest, NamesMember_CXXDependentScopeMemberExpr) { … }
TEST(ASTMatchersTest, ArgumentCountIs_CXXUnresolvedConstructExpr) { … }
TEST(ASTMatchersTest, HasArgument_CXXUnresolvedConstructExpr) { … }
TEST_P(ASTMatchersTest, IsListInitialization) { … }
TEST_P(ASTMatchersTest, IsImplicit_CXXConstructorDecl) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXConstructorDecl) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXConstructorDecl_CXX20) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXDeductionGuideDecl) { … }
TEST_P(ASTMatchersTest, IsExplicit_CXXDeductionGuideDecl_CXX20) { … }
TEST_P(ASTMatchersTest, CXXConstructorDecl_Kinds) { … }
TEST_P(ASTMatchersTest, IsUserProvided) { … }
TEST_P(ASTMatchersTest, IsDelegatingConstructor) { … }
TEST_P(ASTMatchersTest, HasSize) { … }
TEST_P(ASTMatchersTest, HasSize_CXX) { … }
TEST_P(ASTMatchersTest, HasName_MatchesNamespaces) { … }
TEST_P(ASTMatchersTest, HasName_MatchesOuterClasses) { … }
TEST_P(ASTMatchersTest, HasName_MatchesInlinedNamespaces) { … }
TEST_P(ASTMatchersTest, HasName_MatchesAnonymousNamespaces) { … }
TEST_P(ASTMatchersTest, HasName_MatchesAnonymousOuterClasses) { … }
TEST_P(ASTMatchersTest, HasName_MatchesFunctionScope) { … }
TEST_P(ASTMatchersTest, HasName_QualifiedStringMatchesThroughLinkage) { … }
TEST_P(ASTMatchersTest, HasAnyName) { … }
TEST_P(ASTMatchersTest, IsDefinition) { … }
TEST_P(ASTMatchersTest, IsDefinition_CXX) { … }
TEST_P(ASTMatchersTest, HandlesNullQualTypes) { … }
TEST_P(ASTMatchersTest, ObjCIvarRefExpr) { … }
TEST_P(ASTMatchersTest, BlockExpr) { … }
TEST_P(ASTMatchersTest,
StatementCountIs_FindsNoStatementsInAnEmptyCompoundStatement) { … }
TEST_P(ASTMatchersTest, StatementCountIs_AppearsToMatchOnlyOneCount) { … }
TEST_P(ASTMatchersTest, StatementCountIs_WorksWithMultipleStatements) { … }
TEST_P(ASTMatchersTest, StatementCountIs_WorksWithNestedCompoundStatements) { … }
TEST_P(ASTMatchersTest, Member_WorksInSimplestCase) { … }
TEST_P(ASTMatchersTest, Member_DoesNotMatchTheBaseExpression) { … }
TEST_P(ASTMatchersTest, Member_MatchesInMemberFunctionCall) { … }
TEST_P(ASTMatchersTest, FieldDecl) { … }
TEST_P(ASTMatchersTest, IsBitField) { … }
TEST_P(ASTMatchersTest, HasInClassInitializer) { … }
TEST_P(ASTMatchersTest, IsPublic_IsProtected_IsPrivate) { … }
TEST_P(ASTMatchersTest,
HasDynamicExceptionSpec_MatchesDynamicExceptionSpecifications) { … }
TEST_P(ASTMatchersTest,
HasDynamicExceptionSpec_MatchesDynamicExceptionSpecifications_CXX11) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_DoesNotMatchMember) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_MatchesBaseOfVariable) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_MatchesBaseOfVariable_CXX) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_MatchesBaseOfMemberFunc) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_MatchesBaseOfMemberFunc_Template) { … }
TEST_P(ASTMatchersTest, HasObjectExpression_ImplicitlyFormedMemberExpression) { … }
TEST_P(ASTMatchersTest, FieldDecl_DoesNotMatchNonFieldMembers) { … }
TEST_P(ASTMatchersTest, FieldDecl_MatchesField) { … }
TEST_P(ASTMatchersTest, IsVolatileQualified) { … }
TEST_P(ASTMatchersTest, IsConstQualified_MatchesConstInt) { … }
TEST_P(ASTMatchersTest, IsConstQualified_MatchesConstPointer) { … }
TEST_P(ASTMatchersTest, IsConstQualified_MatchesThroughTypedef) { … }
TEST_P(ASTMatchersTest, IsConstQualified_DoesNotMatchInappropriately) { … }
TEST_P(ASTMatchersTest, DeclCountIs_DeclCountIsCorrect) { … }
TEST_P(ASTMatchersTest, EachOf_TriggersForEachMatch) { … }
TEST_P(ASTMatchersTest, EachOf_BehavesLikeAnyOfUnlessBothMatch) { … }
TEST_P(ASTMatchersTest, Optionally_SubmatchersDoNotMatch) { … }
TEST_P(ASTMatchersTest, Optionally_SubmatchersDoNotMatchButPreserveBindings) { … }
TEST_P(ASTMatchersTest, Optionally_SubmatchersMatch) { … }
TEST_P(ASTMatchersTest,
IsTemplateInstantiation_MatchesImplicitClassTemplateInstantiation) { … }
TEST_P(ASTMatchersTest,
IsTemplateInstantiation_MatchesImplicitFunctionTemplateInstantiation) { … }
TEST_P(ASTMatchersTest,
IsTemplateInstantiation_MatchesExplicitClassTemplateInstantiation) { … }
TEST_P(
ASTMatchersTest,
IsTemplateInstantiation_MatchesInstantiationOfPartiallySpecializedClassTemplate) { … }
TEST_P(
ASTMatchersTest,
IsTemplateInstantiation_MatchesInstantiationOfClassTemplateNestedInNonTemplate) { … }
TEST_P(
ASTMatchersTest,
IsTemplateInstantiation_DoesNotMatchInstantiationsInsideOfInstantiation) { … }
TEST_P(
ASTMatchersTest,
IsTemplateInstantiation_DoesNotMatchExplicitClassTemplateSpecialization) { … }
TEST_P(ASTMatchersTest, IsTemplateInstantiation_DoesNotMatchNonTemplate) { … }
TEST_P(ASTMatchersTest, IsInstantiated_MatchesInstantiation) { … }
TEST_P(ASTMatchersTest, IsInstantiated_NotMatchesDefinition) { … }
TEST_P(ASTMatchersTest, IsInTemplateInstantiation_MatchesInstantiationStmt) { … }
TEST_P(ASTMatchersTest, IsInTemplateInstantiation_NotMatchesDefinitionStmt) { … }
TEST_P(ASTMatchersTest, IsInstantiated_MatchesFunctionInstantiation) { … }
TEST_P(ASTMatchersTest, IsInstantiated_NotMatchesFunctionDefinition) { … }
TEST_P(ASTMatchersTest,
IsInTemplateInstantiation_MatchesFunctionInstantiationStmt) { … }
TEST_P(ASTMatchersTest,
IsInTemplateInstantiation_NotMatchesFunctionDefinitionStmt) { … }
TEST_P(ASTMatchersTest, IsInTemplateInstantiation_Sharing) { … }
TEST_P(ASTMatchersTest, IsInstantiationDependent_MatchesNonValueTypeDependent) { … }
TEST_P(ASTMatchersTest, IsInstantiationDependent_MatchesValueDependent) { … }
TEST_P(ASTMatchersTest, IsInstantiationDependent_MatchesTypeDependent) { … }
TEST_P(ASTMatchersTest, IsTypeDependent_MatchesTypeDependent) { … }
TEST_P(ASTMatchersTest, IsTypeDependent_NotMatchesValueDependent) { … }
TEST_P(ASTMatchersTest, IsValueDependent_MatchesValueDependent) { … }
TEST_P(ASTMatchersTest, IsValueDependent_MatchesTypeDependent) { … }
TEST_P(ASTMatchersTest, IsValueDependent_MatchesInstantiationDependent) { … }
TEST_P(ASTMatchersTest,
IsExplicitTemplateSpecialization_DoesNotMatchPrimaryTemplate) { … }
TEST_P(
ASTMatchersTest,
IsExplicitTemplateSpecialization_DoesNotMatchExplicitTemplateInstantiations) { … }
TEST_P(
ASTMatchersTest,
IsExplicitTemplateSpecialization_DoesNotMatchImplicitTemplateInstantiations) { … }
TEST_P(
ASTMatchersTest,
IsExplicitTemplateSpecialization_MatchesExplicitTemplateSpecializations) { … }
TEST_P(ASTMatchersTest, IsNoReturn) { … }
TEST_P(ASTMatchersTest, IsNoReturn_CXX) { … }
TEST_P(ASTMatchersTest, IsNoReturn_CXX11Attribute) { … }
TEST_P(ASTMatchersTest, BooleanType) { … }
TEST_P(ASTMatchersTest, VoidType) { … }
TEST_P(ASTMatchersTest, RealFloatingPointType) { … }
TEST_P(ASTMatchersTest, ArrayType) { … }
TEST_P(ASTMatchersTest, DecayedType) { … }
TEST_P(ASTMatchersTest, ComplexType) { … }
TEST_P(ASTMatchersTest, IsAnonymous) { … }
TEST_P(ASTMatchersTest, InStdNamespace) { … }
TEST_P(ASTMatchersTest, InAnonymousNamespace) { … }
TEST_P(ASTMatchersTest, InStdNamespace_CXX11) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_QualType) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_NonMatchingTypes) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_Stmt) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_Decl) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_Type) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_UsingForEachDescendant) { … }
TEST_P(ASTMatchersTest, EqualsBoundNodeMatcher_FiltersMatchedCombinations) { … }
TEST_P(ASTMatchersTest,
EqualsBoundNodeMatcher_UnlessDescendantsOfAncestorsMatch) { … }
TEST_P(ASTMatchersTest, NullPointerConstant) { … }
TEST_P(ASTMatchersTest, NullPointerConstant_GNUNull) { … }
TEST_P(ASTMatchersTest, NullPointerConstant_GNUNullInTemplate) { … }
TEST_P(ASTMatchersTest, NullPointerConstant_CXX11Nullptr) { … }
TEST_P(ASTMatchersTest, HasExternalFormalLinkage) { … }
TEST_P(ASTMatchersTest, HasExternalFormalLinkage_CXX) { … }
TEST_P(ASTMatchersTest, HasDefaultArgument) { … }
TEST_P(ASTMatchersTest, IsAtPosition) { … }
TEST_P(ASTMatchersTest, IsAtPosition_FunctionDecl) { … }
TEST_P(ASTMatchersTest, IsAtPosition_Lambda) { … }
TEST_P(ASTMatchersTest, IsAtPosition_BlockDecl) { … }
TEST_P(ASTMatchersTest, IsArray) { … }
TEST_P(ASTMatchersTest, HasArraySize) { … }
TEST_P(ASTMatchersTest, HasDefinition_MatchesStructDefinition) { … }
TEST_P(ASTMatchersTest, HasDefinition_MatchesClassDefinition) { … }
TEST_P(ASTMatchersTest, HasDefinition_MatchesUnionDefinition) { … }
TEST_P(ASTMatchersTest, IsScoped_MatchesScopedEnum) { … }
TEST_P(ASTMatchersTest, IsScoped_NotMatchesRegularEnum) { … }
TEST_P(ASTMatchersTest, IsStruct) { … }
TEST_P(ASTMatchersTest, IsUnion) { … }
TEST_P(ASTMatchersTest, IsEnum) { … }
TEST_P(ASTMatchersTest, IsClass) { … }
TEST_P(ASTMatchersTest, HasTrailingReturn_MatchesTrailingReturn) { … }
TEST_P(ASTMatchersTest, HasTrailingReturn_MatchesLambdaTrailingReturn) { … }
TEST_P(ASTMatchersTest, IsAssignmentOperator) { … }
TEST_P(ASTMatchersTest, IsComparisonOperator) { … }
TEST_P(ASTMatchersTest, isRightFold) { … }
TEST_P(ASTMatchersTest, isLeftFold) { … }
TEST_P(ASTMatchersTest, isUnaryFold) { … }
TEST_P(ASTMatchersTest, isBinaryFold) { … }
TEST_P(ASTMatchersTest, hasOperator) { … }
TEST_P(ASTMatchersTest, IsMain) { … }
TEST_P(ASTMatchersTest, OMPExecutableDirective_IsStandaloneDirective) { … }
TEST_P(ASTMatchersTest, OMPExecutableDirective_HasStructuredBlock) { … }
TEST_P(ASTMatchersTest, OMPExecutableDirective_HasClause) { … }
TEST_P(ASTMatchersTest, OMPDefaultClause_IsNoneKind) { … }
TEST_P(ASTMatchersTest, OMPDefaultClause_IsSharedKind) { … }
TEST(OMPDefaultClause, isFirstPrivateKind) { … }
TEST(OMPDefaultClause, istPrivateKind) { … }
TEST_P(ASTMatchersTest, OMPExecutableDirective_IsAllowedToContainClauseKind) { … }
TEST_P(ASTMatchersTest, HasAnyBase_DirectBase) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IndirectBase) { … }
TEST_P(ASTMatchersTest, HasAnyBase_NoBase) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPublic_Public) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPublic_DefaultAccessSpecifierPublic) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPublic_Private) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPublic_DefaultAccessSpecifierPrivate) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPublic_Protected) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPrivate_Private) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPrivate_DefaultAccessSpecifierPrivate) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPrivate_Public) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPrivate_DefaultAccessSpecifierPublic) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsPrivate_Protected) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsProtected_Protected) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsProtected_Public) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsProtected_Private) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsVirtual_Directly) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsVirtual_Indirectly) { … }
TEST_P(ASTMatchersTest, HasAnyBase_IsVirtual_NoVirtualBase) { … }
TEST_P(ASTMatchersTest, HasDirectBase) { … }
TEST_P(ASTMatchersTest, CapturesThis) { … }
TEST_P(ASTMatchersTest, IsImplicit_LambdaCapture) { … }
}
}