[PATCH] D19871: Add an AST matcher for CastExpr kind

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Thu May 12 18:24:22 PDT 2016


etienneb added a comment.

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.


http://reviews.llvm.org/D19871





More information about the cfe-commits mailing list