[cfe-dev] Question regarding hasCastKind matcher
Farzad Sadeghi via cfe-dev
cfe-dev at lists.llvm.org
Sun Dec 4 11:20:56 PST 2016
that works on clang-query but clang will require the CastKind as
argument to work, not a string.
On 12/4/16, David _ <dwiberg at gmail.com> wrote:
> 2016-12-04 11:20 GMT+01:00 Farzad Sadeghi via cfe-dev
> <cfe-dev at lists.llvm.org>:
>> what should be the input to the hasCAstKind matcher?
>> the documentation says "CastKind Kind".
>> so i wrote this matcher:
>> castExpr(hasCastKind(CK_ArrayToPointerDecay))
>>
>> but clang-query returns this:
>> 1:2: Error parsing argument 1 for matcher castExpr.
>> 1:11: Error parsing argument 1 for matcher hasCastKind.
>> 1:25: Error parsing matcher. Found token <_> while looking for '('.
>>
>> so i thought maybe i should give it a string:
>> castExpr(hasCastKind("CK_ArrayToPointerDecay"))
>>
>> but then i get this:
>> 1:2: Error parsing argument 1 for matcher castExpr.
>> 1:11: Error building matcher hasCastKind.
>> 1:23: Incorrect type for arg 1. (Expected = string) != (Actual = String)
>>
>> what should the input be?
>
> Hi,
>
> Try: match castExpr(hasCastKind("ArrayToPointerDecay"))
>
> Best regards
> David
>
>> --
>> Farzad Sadeghi
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
--
Farzad Sadeghi
More information about the cfe-dev
mailing list