Different info in docs in AST methods (#112190)

[Here](6a98c4a160/clang/include/clang/ASTMatchers/ASTMatchers.h (L4188-L4203))
and
[here](6a98c4a160/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](6a98c4a160/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](6a98c4a160/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
This commit is contained in:
Mikhnenko Sasha 2024-10-17 15:44:45 +03:00 committed by GitHub
parent 095d49da76
commit 388d7f1448
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -7239,9 +7239,9 @@ Given
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>

View File

@ -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,