[PATCH] D19871: Add an AST matcher for CastExpr kind
Jonathan Roelofs via cfe-commits
cfe-commits at lists.llvm.org
Fri May 13 06:52:21 PDT 2016
jroelofs added a comment.
In http://reviews.llvm.org/D19871#429153, @etienneb wrote:
> In http://reviews.llvm.org/D19871#428997, @jroelofs wrote:
>
> > Drive-by thought: I think it would be useful to be able to match implicit casts separately from explicit casts when using this new matcher.
>
>
> Jonathan, I think what you are asking for is already supported.
> I added an unittest to confirm it.
>
> EXPECT_TRUE(matches("char *p = 0;",
> implicitCastExpr(hasCastKind(CK_NullToPointer))));
>
>
> If I misunderstood your comment, could you provide an example.
Oh, right. That /is/ exactly what I meant. Excellent.
http://reviews.llvm.org/D19871
More information about the cfe-commits
mailing list