<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54919>54919</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            hasAnyArgument and hasArgument matchers differ in behavior
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          theuni
      </td>
    </tr>
</table>

<pre>
    The trivial matchers:
`callExpr(hasArgument(0, stringLiteral()))` and `callExpr(hasAnyArgument(stringLiteral()))`
should presumably match the same things, but the behaviors are currently different.

Thanks again @AaronBallman for the help.

>From IRC (snipped):

> \<AaronBallman\> cfields: yeah, I can reproduce that and it is a bit of a surprise to me
> \<AaronBallman\> cfields: the issue has to do with the implicit cast
> \<AaronBallman\> https://godbolt.org/z/1KhTaY86e
> \<cfields\> AaronBallman: oddly enough, setting TK_IgnoreUnlessSpelledInSource aligns the behaviors.
> \<cfields\> Ok, that makes sense then.
> \<AaronBallman\> ah
> \<AaronBallman\> it's a difference in implementations in ASTMatchers.h
> \<AaronBallman\> hasArgument is calling IgnoreParenImpCasts() on the argument and hasAnyArgument is not
> \<cfields\> AaronBallman: shall I file a bug report? at the least it would be nice to have the difference documented.
> \<AaronBallman\> cfields: yeah, I think you should file a bug report (thank you for the offer). I don't know which interface *should* change to make things consistent, but one of them should probably budge
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVMtu2zAQ_Br5QtSQJfl10MFxYsBIixaNe-ipoMiVxJoiBT6Sul_fJWWlSRykKSDLJEXuDmdnttL8VB5aIM6Ie0El6ahjLRib5JskvU7STbJIGZXy5ldvkmzVUrsxje9AOZylSbYlFo-q5qNwYKjExSRbn59FSqji5DKCOj0J8tb5AYJttZec9Aas72glTwNK4hC3pR2CbzGCDWAq7-JyBS29F9pYQg0Q5o3BZHiQi7qGMJ6ebxffh5aqI25tqFAkKd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