@@ -811,7 +811,7 @@ AST_POLYMORPHIC_MATCHER(isProtected,
811
811
// / matches \match{struct Derived1 : private Base {}} and
812
812
// / \match{class Derived2 : Base {}}, with
813
813
// / \matcher{type=sub$cxxBaseSpecifier(isPrivate())} matching
814
- // / \match{sub=base;count=2$Base}.
814
+ // / \match{sub=base;count=2$Base} each time .
815
815
AST_POLYMORPHIC_MATCHER (isPrivate,
816
816
AST_POLYMORPHIC_SUPPORTED_TYPES (Decl,
817
817
CXXBaseSpecifier)) {
@@ -1224,7 +1224,7 @@ AST_MATCHER_P_OVERLOAD(Expr, ignoringParens, internal::Matcher<Expr>,
1224
1224
// / The matcher \matcher{expr(isInstantiationDependent())}
1225
1225
// / matches \match{sizeof(T() + T())},
1226
1226
// / \match{(T() + T())},
1227
- // / \match{T() + T()} and \match{count=2$T()}.
1227
+ // / \match{T() + T()} and two time \match{count=2$T()}.
1228
1228
AST_MATCHER (Expr, isInstantiationDependent) {
1229
1229
return Node.isInstantiationDependent ();
1230
1230
}
@@ -2372,8 +2372,9 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXBindTemporaryExpr>
2372
2372
// / \compile_args{-std=c++}
2373
2373
// / The matcher \matcher{materializeTemporaryExpr()} matches
2374
2374
// / \match{std=c++14-or-earlier;count=3$f()} three times before C++17 and it
2375
- // / matches \match{std=c++17-or-later$f()} time with C++17 and later, but
2376
- // / it does not match the \nomatch{f()} in the last line in any version.
2375
+ // / matches \match{std=c++17-or-later$f()} one time with C++17 and later for
2376
+ // / \c f().func() , but it does not match the \nomatch{f()} in the last line in
2377
+ // / any version.
2377
2378
extern const internal::VariadicDynCastAllOfMatcher<Stmt,
2378
2379
MaterializeTemporaryExpr>
2379
2380
materializeTemporaryExpr;
@@ -4665,8 +4666,10 @@ AST_MATCHER(CXXRecordDecl, isLambda) {
4665
4666
// / \endcode
4666
4667
// / \compile_args{-std=c++}
4667
4668
// / The matcher \matcher{cxxRecordDecl(has(cxxRecordDecl(hasName("X"))))}
4668
- // / matches \match{count=3$class X {}} three times,
4669
- // / and \match{count=2$class Y { class X {}; }} two times.
4669
+ // / matches \match{count=3$class X {}} three times for the definitions of \c X
4670
+ // / that contain the implicit class declarations of \c X ,
4671
+ // / and \match{count=2$class Y { class X {}; }} two times for the two different
4672
+ // / definitions of \c Y that contain \c X .
4670
4673
// /
4671
4674
// / ChildT must be an AST base type.
4672
4675
// /
@@ -4698,8 +4701,10 @@ extern const internal::ArgumentAdaptingMatcherFunc<internal::HasMatcher> has;
4698
4701
// / \compile_args{-std=c++}
4699
4702
// / The matcher
4700
4703
// / \matcher{cxxRecordDecl(hasDescendant(cxxRecordDecl(hasName("X"))))}
4701
- // / matches \match{count=3$class X {}}, \match{count=2$class Y { class X {}; }}
4702
- // / and \match{class Z { class Y { class X {}; }; }}.
4704
+ // / matches \match{count=3$class X {}} three times for the definitions of \c X
4705
+ // / that contain the implicit class declarations of \c X ,
4706
+ // / \match{count=2$class Y { class X {}; }} two times for the declaration of
4707
+ // / \c X they contain, and \match{class Z { class Y { class X {}; }; }}.
4703
4708
// /
4704
4709
// / DescendantT must be an AST base type.
4705
4710
// /
@@ -4887,13 +4892,12 @@ extern const internal::ArgumentAdaptingMatcherFunc<
4887
4892
// /
4888
4893
// / Given
4889
4894
// / \code
4890
- // / class X {} ;
4891
- // / class Y {} ;
4895
+ // / int x ;
4896
+ // / int y = 0 ;
4892
4897
// / \endcode
4893
4898
// / \compile_args{-std=c++}
4894
- // / The matcher \matcher{cxxRecordDecl(unless(hasName("X")))}
4895
- // / matches \match{type=name;count=2$Y} twice, once for the definition
4896
- // / and once for the implicit class declaration.
4899
+ // / The matcher \matcher{varDecl(unless(hasInitializer(expr())))}
4900
+ // / matches \match{int x}, but not \nomatch{int y = 0}.
4897
4901
// /
4898
4902
// / Usable as: Any Matcher
4899
4903
extern const internal::VariadicOperatorMatcherFunc<1 , 1 > unless;
@@ -7801,7 +7805,7 @@ AST_POLYMORPHIC_MATCHER_P(hasUnaryOperand,
7801
7805
// / \matcher{opaqueValueExpr(hasSourceExpression(
7802
7806
// / implicitCastExpr(has(
7803
7807
// / implicitCastExpr(has(declRefExpr()))))))}
7804
- // / matches \match{count=2$b} twice, for the conditiona and the true expression.
7808
+ // / matches \match{count=2$b} twice, for the condition and the true expression.
7805
7809
AST_POLYMORPHIC_MATCHER_P (hasSourceExpression,
7806
7810
AST_POLYMORPHIC_SUPPORTED_TYPES (CastExpr,
7807
7811
OpaqueValueExpr),
@@ -7864,17 +7868,14 @@ AST_MATCHER_P(ImplicitCastExpr, hasImplicitDestinationType,
7864
7868
// /
7865
7869
// / Example matches S, but not C, U or E.
7866
7870
// / \code
7867
- // / struct S {} ;
7868
- // / class C {} ;
7869
- // / union U {} ;
7870
- // / enum E { Ok } ;
7871
+ // / struct S;
7872
+ // / class C;
7873
+ // / union U;
7874
+ // / enum E;
7871
7875
// / \endcode
7872
7876
// / \compile_args{-std=c++}
7873
- // / The matcher \matcher{tagDecl(isStruct())}
7874
- // / matches \match{type=typestr;count=2$struct S},
7875
- // / but does not match \nomatch{type=typestr;count=2$class C},
7876
- // / \nomatch{type=typestr;count=2$union U}
7877
- // / or \nomatch{type=typestr;count=2$enum E}.
7877
+ // / The matcher \matcher{tagDecl(isStruct())} matches \match{struct S},
7878
+ // / but does not match \nomatch{class C}, \nomatch{union U} or \nomatch{enum E}.
7878
7879
AST_MATCHER (TagDecl, isStruct) {
7879
7880
return Node.isStruct ();
7880
7881
}
@@ -7883,17 +7884,14 @@ AST_MATCHER(TagDecl, isStruct) {
7883
7884
// /
7884
7885
// / Given
7885
7886
// / \code
7886
- // / struct S {} ;
7887
- // / class C {} ;
7888
- // / union U {} ;
7889
- // / enum E { Ok } ;
7887
+ // / struct S;
7888
+ // / class C;
7889
+ // / union U;
7890
+ // / enum E;
7890
7891
// / \endcode
7891
7892
// / \compile_args{-std=c++}
7892
- // / The matcher \matcher{tagDecl(isUnion())}
7893
- // / matches \match{type=typestr;count=2$union U},
7894
- // / does not match \nomatch{type=typestr;count=2$struct S},
7895
- // / \nomatch{type=typestr;count=2$class C}
7896
- // / or \nomatch{type=typestr;count=2$enum E}.
7893
+ // / The matcher \matcher{tagDecl(isUnion())} matches \match{union U}, but does
7894
+ // / not match \nomatch{struct S}, \nomatch{class C} or \nomatch{enum E}.
7897
7895
AST_MATCHER (TagDecl, isUnion) {
7898
7896
return Node.isUnion ();
7899
7897
}
@@ -7902,17 +7900,14 @@ AST_MATCHER(TagDecl, isUnion) {
7902
7900
// /
7903
7901
// / Given
7904
7902
// / \code
7905
- // / struct S {} ;
7906
- // / class C {} ;
7907
- // / union U {} ;
7908
- // / enum E { Ok } ;
7903
+ // / struct S;
7904
+ // / class C;
7905
+ // / union U;
7906
+ // / enum E;
7909
7907
// / \endcode
7910
7908
// / \compile_args{-std=c++}
7911
- // / The matcher \matcher{tagDecl(isClass())}
7912
- // / matches \match{type=typestr;count=2$class C},
7913
- // / but does not match \nomatch{type=typestr;count=2$struct S},
7914
- // / \nomatch{type=typestr;count=2$union U}
7915
- // / or \nomatch{type=typestr;count=2$enum E}.
7909
+ // / The matcher \matcher{tagDecl(isClass())} matches \match{class C}, but does
7910
+ // / not match \nomatch{struct S}, \nomatch{union U} or \nomatch{enum E}.
7916
7911
AST_MATCHER (TagDecl, isClass) {
7917
7912
return Node.isClass ();
7918
7913
}
@@ -7921,16 +7916,14 @@ AST_MATCHER(TagDecl, isClass) {
7921
7916
// /
7922
7917
// / Given
7923
7918
// / \code
7924
- // / struct S {} ;
7925
- // / class C {} ;
7926
- // / union U {} ;
7927
- // / enum E { Ok } ;
7919
+ // / struct S;
7920
+ // / class C;
7921
+ // / union U;
7922
+ // / enum E;
7928
7923
// / \endcode
7929
7924
// / \compile_args{-std=c++}
7930
- // / The matcher \matcher{tagDecl(isEnum())}
7931
- // / matches \match{count=1$enum E { Ok }},
7932
- // / but does not match \nomatch{count=2$struct S {}},
7933
- // / \nomatch{count=2$class C {}} or \nomatch{count=2$union U {}}.
7925
+ // / The matcher \matcher{tagDecl(isEnum())} matches \match{enum E}, but does not
7926
+ // / match \nomatch{struct S}, \nomatch{class C} or \nomatch{union U}.
7934
7927
AST_MATCHER (TagDecl, isEnum) {
7935
7928
return Node.isEnum ();
7936
7929
}
@@ -9415,7 +9408,7 @@ extern const AstTypeMatcher<LValueReferenceType> lValueReferenceType;
9415
9408
// /
9416
9409
// / The matcher \matcher{rValueReferenceType()} matches the type
9417
9410
// / \match{type=typestr$int &&} of \c c and the type
9418
- // / \match{type=typestr;count=2$auto &&} of \c f.
9411
+ // / \match{type=typestr;count=2$auto &&} of \c e and \c f.
9419
9412
extern const AstTypeMatcher<RValueReferenceType> rValueReferenceType;
9420
9413
9421
9414
// / Narrows PointerType (and similar) matchers to those where the
@@ -9552,7 +9545,7 @@ extern const AstTypeMatcher<UnaryTransformType> unaryTransformType;
9552
9545
// / declaration of \c s.
9553
9546
// / Both of these types are matched three times, once for the type of the
9554
9547
// / variable, once for the definition of the class, and once for the type of the
9555
- // / injected class name .
9548
+ // / implicit class declaration .
9556
9549
extern const AstTypeMatcher<RecordType> recordType;
9557
9550
9558
9551
// / Matches tag types (record and enum types).
@@ -9571,7 +9564,7 @@ extern const AstTypeMatcher<RecordType> recordType;
9571
9564
// / \match{type=typestr$enum E} of variable \c e and the type
9572
9565
// / \match{type=typestr;count=3;std=c++$class C} three times, once for the type
9573
9566
// / of the variable \c c , once for the type of the class definition and once of
9574
- // / the type in the injected class name .
9567
+ // / the type in the implicit class declaration .
9575
9568
extern const AstTypeMatcher<TagType> tagType;
9576
9569
9577
9570
// / Matches types specified with an elaborated type keyword or with a
@@ -9594,10 +9587,10 @@ extern const AstTypeMatcher<TagType> tagType;
9594
9587
// / The matcher \matcher{elaboratedType()} matches the type
9595
9588
// / \match{type=typestr;count=3$C} three times. Once for the type of the
9596
9589
// / variable \c c, once for the type of the class definition and once for the
9597
- // / type in the injected class name . For \c{class D}, it matches
9590
+ // / type in the implicit class declaration . For \c{class D}, it matches
9598
9591
// / \match{type=typestr$N::M::D} of variable \c d and its class definition and
9599
- // / injected class name
9600
- // / \match{type=typestr;count=2$D} one time respectively.
9592
+ // / implicit class declaration \match{type=typestr;count=2$D} one time
9593
+ // / respectively.
9601
9594
extern const AstTypeMatcher<ElaboratedType> elaboratedType;
9602
9595
9603
9596
// / Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier,
@@ -9737,7 +9730,8 @@ extern const AstTypeMatcher<InjectedClassNameType> injectedClassNameType;
9737
9730
// / matches \match{int i[]} in declaration of \c{f}.
9738
9731
// / The matcher
9739
9732
// / \matcher{expr(hasType(decayedType(hasDecayedType(pointerType()))))}
9740
- // / matches \match{count=2$i} in \c{i[1]}.
9733
+ // / matches \match{count=2$i} twice, once for the \c DeclRefExpr and oncde for
9734
+ // / the cast from an l- to an r-value in \c{i[1]}.
9741
9735
// /
9742
9736
extern const AstTypeMatcher<DecayedType> decayedType;
9743
9737
@@ -9810,7 +9804,8 @@ extern const internal::VariadicAllOfMatcher<NestedNameSpecifier>
9810
9804
// / \compile_args{-std=c++}
9811
9805
// /
9812
9806
// / The matcher \matcher{nestedNameSpecifierLoc()} matches
9813
- // / \match{count=2$A::} twice, and \match{ns::} once.
9807
+ // / \match{count=2$A::} twice for the spellings in \c A::f() and \c ns::A ,
9808
+ // / and \match{ns::} once.
9814
9809
extern const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
9815
9810
nestedNameSpecifierLoc;
9816
9811
@@ -9830,7 +9825,7 @@ extern const internal::VariadicAllOfMatcher<NestedNameSpecifierLoc>
9830
9825
// /
9831
9826
// / The matcher \matcher{nestedNameSpecifierLoc(loc(specifiesType(
9832
9827
// / hasDeclaration(namedDecl(hasName("A"))))))} matches \match{count=2$A::}
9833
- // / twice.
9828
+ // / twice for the spellings in \c A::f() and \c ns::A .
9834
9829
AST_MATCHER_FUNCTION_P_OVERLOAD (
9835
9830
internal::BindableMatcher<NestedNameSpecifierLoc>, loc,
9836
9831
internal::Matcher<NestedNameSpecifier>, InnerMatcher, 1 ) {
@@ -9994,8 +9989,8 @@ AST_MATCHER_P_OVERLOAD(Type, equalsNode, const Type*, Other, 2) {
9994
9989
// / \matcher{switchStmt(forEachSwitchCase(caseStmt().bind("c")))}
9995
9990
// / matches four times, matching
9996
9991
// / \match{count=2$switch (1) { case 1: case 2: default: switch (2) { case 3:
9997
- // / case 4: ; } }} and
9998
- // / \match{count=2$switch (2) { case 3: case 4: ; }}, with
9992
+ // / case 4: ; } }} twice and
9993
+ // / \match{count=2$switch (2) { case 3: case 4: ; }} twice , with
9999
9994
// / \matcher{type=sub$caseStmt()} matching each of \match{sub=c$case 1:},
10000
9995
// / \match{sub=c$case 2:}, \match{sub=c$case 3:}
10001
9996
// / and \match{sub=c$case 4:}.
0 commit comments