<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75754>75754</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
hasAnyArgument() spuriously ignores match
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
xb8g2pw0
</td>
</tr>
</table>
<pre>
`hasAnyArgument()` spuriously ignores a match with the program:
```
void foo (void *, void *);
struct S {
};
void f() {
S s;
foo(&s, &s);
}
```
and the query:
```
m callExpr(hasAnyArgument(hasType(asString("S *"))))
0 matches.
```
However, the query:
```
m callExpr(hasArgument(0,hasType(asString("S *"))))
```
returns the expected result:
```
...clang_ast_bug_2.cpp:10:2: note: "root" binds here
10 | foo(&s, &s);
| ^~~~~~~~~~~
1 match.
```
I am using clang-query 17.0.2 built, I believe, by Mozilla.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclM9vqzgQx_-a4TIqMgMEcuCQNo22hz1l75WBCXhlMGubpNnD_u0rIG3SvOhJ7yHLP5Kvv_OZsWXpnGp65gLSZ0i3gRx9a2zxUeYNDScRlKY-F7ASrXSb_ryxzdhx74FyoDWsBLphtMqMTp9RNb2x7FBiJ33V4kn5Fn3LOFjTWNlBvAGxBXHpEVbi0ub10agaD8YgUD7PgTZAL3idryF-vnVw3o6Vxz1C9vl7tr3TLK4L741OrPfobqTrgzGzaOWmmMt4Ey_bXibfmWVfzxn-M7I93-V3J-2wklq_fgwWKP-hmq10f50HBsql23ur-mamof2SOU0wX232E0uV2YX4MN7S_2FOfGQ75fS7nFdIAfTy66B3_pb9aHs34_DHwJXnGi27Ufsr2PctYRhWWvbNu3T-vRybdwqrYYB4EwmINwTxBnvjeRqByBrjgQhL1dcOW7Z8uW-RQMhe8PP7-Ykvmls9pK__fX2LKFrOIHxI_Yayw9GpvsGZ_mkuPkZZKELCclTaT4HfsGSt-MjTojzjn-ZfpbW8eAZ1EdfreC0DLqJMUJ7GeR4FbSFjydWBsqSMyjqphawOZRaXeRmlVZRwHaiCBMURRRlRmosoPMgqr7KkSlZxkgmqIBHcSaVDrY9daGwTKOdGLrI0S5NAy5K1m18Fop5POP85HXC6DWwx7Xkqx8ZBIrRy3l1dvPKai0fvxaPHYi5gMFpdtN4PbroCtAPaNcq3YxlWpgPaTd6X4Wmw5m-uPNBuJnJAu5n4_wAAAP__S5RalA">