[cfe-dev] Question regarding hasCastKind matcher

David _ via cfe-dev cfe-dev at lists.llvm.org
Sun Dec 4 07:55:45 PST 2016


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



More information about the cfe-dev mailing list