@@ -662,6 +662,18 @@ <h2 id="decl-matchers">Node Matchers</h2>
662
662
</ pre > </ td > </ tr >
663
663
664
664
665
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('autoreleasePoolStmt0') "> < a name ="autoreleasePoolStmt0Anchor "> autoreleasePoolStmt</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ObjCAutoreleasePoolStmt.html "> ObjCAutoreleasePoolStmt</ a > >...</ td > </ tr >
666
+ < tr > < td colspan ="4 " class ="doc " id ="autoreleasePoolStmt0 "> < pre > Matches an Objective-C autorelease pool statement.
667
+
668
+ Given
669
+ @autoreleasepool {
670
+ int x = 0;
671
+ }
672
+ autoreleasePoolStmt(stmt()) matches the declaration of "x"
673
+ inside the autorelease pool.
674
+ </ pre > </ td > </ tr >
675
+
676
+
665
677
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html "> Stmt</ a > ></ td > < td class ="name " onclick ="toggle('binaryConditionalOperator0') "> < a name ="binaryConditionalOperator0Anchor "> binaryConditionalOperator</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1BinaryConditionalOperator.html "> BinaryConditionalOperator</ a > >...</ td > </ tr >
666
678
< tr > < td colspan ="4 " class ="doc " id ="binaryConditionalOperator0 "> < pre > Matches binary conditional operator expressions (GNU extension).
667
679
@@ -5222,8 +5234,8 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
5222
5234
</ pre > </ td > </ tr >
5223
5235
5224
5236
5225
- < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Expr.html "> Expr</ a > ></ td > < td class ="name " onclick ="toggle('hasType3 ') "> < a name ="hasType3Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > > InnerMatcher</ td > </ tr >
5226
- < tr > < td colspan ="4 " class ="doc " id ="hasType3 "> < pre > Overloaded to match the declaration of the expression's or value
5237
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Expr.html "> Expr</ a > ></ td > < td class ="name " onclick ="toggle('hasType4 ') "> < a name ="hasType4Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > > InnerMatcher</ td > </ tr >
5238
+ < tr > < td colspan ="4 " class ="doc " id ="hasType4 "> < pre > Overloaded to match the declaration of the expression's or value
5227
5239
declaration's type.
5228
5240
5229
5241
In case of a value declaration (for example a variable declaration),
@@ -5234,8 +5246,10 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
5234
5246
5235
5247
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
5236
5248
and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
5249
+ and friend class X (matcher = friendDecl(hasType("X"))
5237
5250
class X {};
5238
5251
void y(X &x) { x; X z; }
5252
+ class Y { friend class X; };
5239
5253
5240
5254
Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Expr.html "> Expr</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > >
5241
5255
</ pre > </ td > </ tr >
@@ -5248,9 +5262,11 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
5248
5262
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
5249
5263
and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
5250
5264
and U (matcher = typedefDecl(hasType(asString("int")))
5265
+ and friend class X (matcher = friendDecl(hasType("X"))
5251
5266
class X {};
5252
5267
void y(X &x) { x; X z; }
5253
5268
typedef int U;
5269
+ class Y { friend class X; };
5254
5270
</ pre > </ td > </ tr >
5255
5271
5256
5272
@@ -5396,6 +5412,42 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
5396
5412
</ pre > </ td > </ tr >
5397
5413
5398
5414
5415
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1FriendDecl.html "> FriendDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType5') "> < a name ="hasType5Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > > InnerMatcher</ td > </ tr >
5416
+ < tr > < td colspan ="4 " class ="doc " id ="hasType5 "> < pre > Overloaded to match the declaration of the expression's or value
5417
+ declaration's type.
5418
+
5419
+ In case of a value declaration (for example a variable declaration),
5420
+ this resolves one layer of indirection. For example, in the value
5421
+ declaration "X x;", cxxRecordDecl(hasName("X")) matches the declaration of
5422
+ X, while varDecl(hasType(cxxRecordDecl(hasName("X")))) matches the
5423
+ declaration of x.
5424
+
5425
+ Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
5426
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
5427
+ and friend class X (matcher = friendDecl(hasType("X"))
5428
+ class X {};
5429
+ void y(X &x) { x; X z; }
5430
+ class Y { friend class X; };
5431
+
5432
+ Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Expr.html "> Expr</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > >
5433
+ </ pre > </ td > </ tr >
5434
+
5435
+
5436
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1FriendDecl.html "> FriendDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType1') "> < a name ="hasType1Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
5437
+ < tr > < td colspan ="4 " class ="doc " id ="hasType1 "> < pre > Matches if the expression's or declaration's type matches a type
5438
+ matcher.
5439
+
5440
+ Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
5441
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
5442
+ and U (matcher = typedefDecl(hasType(asString("int")))
5443
+ and friend class X (matcher = friendDecl(hasType("X"))
5444
+ class X {};
5445
+ void y(X &x) { x; X z; }
5446
+ typedef int U;
5447
+ class Y { friend class X; };
5448
+ </ pre > </ td > </ tr >
5449
+
5450
+
5399
5451
< tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html "> FunctionDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasAnyParameter0') "> < a name ="hasAnyParameter0Anchor "> hasAnyParameter</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html "> ParmVarDecl</ a > > InnerMatcher</ td > </ tr >
5400
5452
< tr > < td colspan ="4 " class ="doc " id ="hasAnyParameter0 "> < pre > Matches any parameter of a function or an ObjC method declaration or a
5401
5453
block.
@@ -6432,16 +6484,18 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
6432
6484
</ pre > </ td > </ tr >
6433
6485
6434
6486
6435
- < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypedefNameDecl.html "> TypedefNameDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType1 ') "> < a name ="hasType1Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
6436
- < tr > < td colspan ="4 " class ="doc " id ="hasType1 "> < pre > Matches if the expression's or declaration's type matches a type
6487
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1TypedefNameDecl.html "> TypedefNameDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType2 ') "> < a name ="hasType2Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
6488
+ < tr > < td colspan ="4 " class ="doc " id ="hasType2 "> < pre > Matches if the expression's or declaration's type matches a type
6437
6489
matcher.
6438
6490
6439
6491
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
6440
6492
and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
6441
6493
and U (matcher = typedefDecl(hasType(asString("int")))
6494
+ and friend class X (matcher = friendDecl(hasType("X"))
6442
6495
class X {};
6443
6496
void y(X &x) { x; X z; }
6444
6497
typedef int U;
6498
+ class Y { friend class X; };
6445
6499
</ pre > </ td > </ tr >
6446
6500
6447
6501
@@ -6564,8 +6618,8 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
6564
6618
matches using X::b but not using X::a </ pre > </ td > </ tr >
6565
6619
6566
6620
6567
- < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType4 ') "> < a name ="hasType4Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > > InnerMatcher</ td > </ tr >
6568
- < tr > < td colspan ="4 " class ="doc " id ="hasType4 "> < pre > Overloaded to match the declaration of the expression's or value
6621
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType6 ') "> < a name ="hasType6Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Decl.html "> Decl</ a > > InnerMatcher</ td > </ tr >
6622
+ < tr > < td colspan ="4 " class ="doc " id ="hasType6 "> < pre > Overloaded to match the declaration of the expression's or value
6569
6623
declaration's type.
6570
6624
6571
6625
In case of a value declaration (for example a variable declaration),
@@ -6576,23 +6630,27 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
6576
6630
6577
6631
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
6578
6632
and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
6633
+ and friend class X (matcher = friendDecl(hasType("X"))
6579
6634
class X {};
6580
6635
void y(X &x) { x; X z; }
6636
+ class Y { friend class X; };
6581
6637
6582
6638
Usable as: Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1Expr.html "> Expr</ a > >, Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > >
6583
6639
</ pre > </ td > </ tr >
6584
6640
6585
6641
6586
- < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType2 ') "> < a name ="hasType2Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
6587
- < tr > < td colspan ="4 " class ="doc " id ="hasType2 "> < pre > Matches if the expression's or declaration's type matches a type
6642
+ < tr > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html "> ValueDecl</ a > ></ td > < td class ="name " onclick ="toggle('hasType3 ') "> < a name ="hasType3Anchor "> hasType</ a > </ td > < td > Matcher<< a href ="http://clang.llvm.org/doxygen/classclang_1_1QualType.html "> QualType</ a > > InnerMatcher</ td > </ tr >
6643
+ < tr > < td colspan ="4 " class ="doc " id ="hasType3 "> < pre > Matches if the expression's or declaration's type matches a type
6588
6644
matcher.
6589
6645
6590
6646
Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
6591
6647
and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
6592
6648
and U (matcher = typedefDecl(hasType(asString("int")))
6649
+ and friend class X (matcher = friendDecl(hasType("X"))
6593
6650
class X {};
6594
6651
void y(X &x) { x; X z; }
6595
6652
typedef int U;
6653
+ class Y { friend class X; };
6596
6654
</ pre > </ td > </ tr >
6597
6655
6598
6656
0 commit comments