Skip to content

Commit 388d7f1

Browse files
authored
Different info in docs in AST methods (#112190)
[Here](https://github.com/llvm/llvm-project/blob/6a98c4a1602591c942f01dceb3aa29ffd4cf1e5b/clang/include/clang/ASTMatchers/ASTMatchers.h#L4188-L4203) and [here](https://github.com/llvm/llvm-project/blob/6a98c4a1602591c942f01dceb3aa29ffd4cf1e5b/clang/include/clang/ASTMatchers/ASTMatchers.h#L3679-L3695) we can see similar code samples and same examples: ``` cxxMemberCallExpr(on(callExpr())) ``` In the first case, it is [written](https://github.com/llvm/llvm-project/blob/6a98c4a1602591c942f01dceb3aa29ffd4cf1e5b/clang/include/clang/ASTMatchers/ASTMatchers.h#L4201) that the object must not be matched: ``` /// cxxMemberCallExpr(on(callExpr())) /// does not match `(g()).m()`, because the parens are not ignored. ``` In the second case, it is [written](https://github.com/llvm/llvm-project/blob/6a98c4a1602591c942f01dceb3aa29ffd4cf1e5b/clang/include/clang/ASTMatchers/ASTMatchers.h#L3693) that the object must be matched: ``` /// cxxMemberCallExpr(on(callExpr())) /// matches `(g()).m()`. ``` I think that parens are ignored
1 parent 095d49d commit 388d7f1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/docs/LibASTMatchersReference.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7239,9 +7239,9 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
72397239
void z(Y y, X x) { y.m(); x.m(); x.g(); (g()).m(); }
72407240
cxxMemberCallExpr(onImplicitObjectArgument(hasType(
72417241
cxxRecordDecl(hasName("Y")))))
7242-
matches `y.m()`, `x.m()` and (g()).m(), but not `x.g()`.
7242+
matches `y.m()`, `x.m()` and (`g()).m()`, but not `x.g()`).
72437243
cxxMemberCallExpr(on(callExpr()))
7244-
does not match `(g()).m()`, because the parens are not ignored.
7244+
only matches `(g()).m()` (the parens are ignored).
72457245

72467246
FIXME: Overload to allow directly matching types?
72477247
</pre></td></tr>

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,9 +4197,9 @@ AST_MATCHER_P_OVERLOAD(QualType, references, internal::Matcher<Decl>,
41974197
/// \endcode
41984198
/// cxxMemberCallExpr(onImplicitObjectArgument(hasType(
41994199
/// cxxRecordDecl(hasName("Y")))))
4200-
/// matches `y.m()`, `x.m()` and (g()).m(), but not `x.g()`.
4200+
/// matches `y.m()`, `x.m()` and (`g()).m()`, but not `x.g()`).
42014201
/// cxxMemberCallExpr(on(callExpr()))
4202-
/// does not match `(g()).m()`, because the parens are not ignored.
4202+
/// only matches `(g()).m()` (the parens are ignored).
42034203
///
42044204
/// FIXME: Overload to allow directly matching types?
42054205
AST_MATCHER_P(CXXMemberCallExpr, onImplicitObjectArgument,

0 commit comments

Comments
 (0)