mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 17:06:07 +00:00
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:
parent
095d49da76
commit
388d7f1448
@ -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>
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user