[clang] 388d7f1 - Different info in docs in AST methods (#112190)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 17 05:44:49 PDT 2024
Author: Mikhnenko Sasha
Date: 2024-10-17T08:44:45-04:00
New Revision: 388d7f144880dcd85ff31f06793304405a9f44b6
URL: https://github.com/llvm/llvm-project/commit/388d7f144880dcd85ff31f06793304405a9f44b6
DIFF: https://github.com/llvm/llvm-project/commit/388d7f144880dcd85ff31f06793304405a9f44b6.diff
LOG: 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
Added:
Modified:
clang/docs/LibASTMatchersReference.html
clang/include/clang/ASTMatchers/ASTMatchers.h
Removed:
################################################################################
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html
index a16b9c44ef0eab..c6307954d7f1bb 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -7239,9 +7239,9 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
void z(Y y, X x) { y.m(); x.m(); x.g(); (g()).m(); }
cxxMemberCallExpr(onImplicitObjectArgument(hasType(
cxxRecordDecl(hasName("Y")))))
- matches `y.m()`, `x.m()` and (g()).m(), but not `x.g()`.
+ matches `y.m()`, `x.m()` and (`g()).m()`, but not `x.g()`).
cxxMemberCallExpr(on(callExpr()))
- does not match `(g()).m()`, because the parens are not ignored.
+ only matches `(g()).m()` (the parens are ignored).
FIXME: Overload to allow directly matching types?
</pre></td></tr>
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index f1c72efc238784..54e484d41fb1c3 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -4197,9 +4197,9 @@ AST_MATCHER_P_OVERLOAD(QualType, references, internal::Matcher<Decl>,
/// \endcode
/// cxxMemberCallExpr(onImplicitObjectArgument(hasType(
/// cxxRecordDecl(hasName("Y")))))
-/// matches `y.m()`, `x.m()` and (g()).m(), but not `x.g()`.
+/// matches `y.m()`, `x.m()` and (`g()).m()`, but not `x.g()`).
/// cxxMemberCallExpr(on(callExpr()))
-/// does not match `(g()).m()`, because the parens are not ignored.
+/// only matches `(g()).m()` (the parens are ignored).
///
/// FIXME: Overload to allow directly matching types?
AST_MATCHER_P(CXXMemberCallExpr, onImplicitObjectArgument,
More information about the cfe-commits
mailing list