-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hasAnyArgument() spuriously ignores match #75754
Comments
So if you want m callExpr(hasAnyArgument(ignoringParenImpCasts(hasType(asString("S *")))))
Match #1:
...test.cpp:8:4: note: "root" binds here
foo(&s, &s);
^~~~~~~~~~~
1 match.
|
@llvm/issue-subscribers-clang-frontend Author: None (xb8g2pw0)
`hasAnyArgument()` spuriously ignores a match with the program:
and the query:
However, the query:
returns the expected result:
I am using clang-query 17.0.2 built, I believe, by Mozilla. |
@llvm/issue-subscribers-clang-query Author: None (xb8g2pw0)
`hasAnyArgument()` spuriously ignores a match with the program:
and the query:
However, the query:
returns the expected result:
I am using clang-query 17.0.2 built, I believe, by Mozilla. |
Thanks for the info. Probably this should be considered a documentation bug? https://clang.llvm.org/docs/LibASTMatchersReference.html does not describe this difference between |
I think it's a functionality bug and not a documentation bug. The intent behind |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: None (xb8g2pw0)
`hasAnyArgument()` spuriously ignores a match with the program:
and the query:
However, the query:
returns the expected result:
I am using clang-query 17.0.2 built, I believe, by Mozilla. |
I'm marking this as a good first issue because I think the correct behavior is to not ignore implicit AST nodes in Note, this may cause some fallout that makes this not quite a good first issue because we may have clang-tidy checks that rely on ignoring the implicit nodes. So the fix may be somewhat more involved due to needing to also repair problems with clang-tidy checks. CC @PiotrZSL @carlosgalvezp @njames93 @LegalizeAdulthood @sam-mccall for extra opinions and thoughts. |
I say go for it. If anyone fixing this gets weird fallout in |
@AaronBallman @LegalizeAdulthood |
so I removed this additional condition
|
Hello! |
That's correct! |
Most probably better will be to change all current usages of |
@AaronBallman I would like to take up this issue, please assign it to me. |
Hi @AaronBallman, I have run LLVM regression tests. And ninja check-clang command is running.Please help me with which tests to run. |
|
@komalverma04 Was this ever fixed? Looking at the PR history isn't too clear, can you close this if it is fixed? |
hasAnyArgument()
spuriously ignores a match with the program:and the query:
However, the query:
returns the expected result:
I am using clang-query 17.0.2 built, I believe, by Mozilla.
The text was updated successfully, but these errors were encountered: