[PATCH] D44729: [ASTMatchers] Add hasSubExpr() matcher.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 21 05:44:30 PDT 2018


aaron.ballman added a comment.

I think `hasSourceExpression()` already does what you're looking for.

  void f() {
    int i = 1.0f;
  }

clang-query> match implicitCastExpr(hasSourceExpression(floatLiteral()))

Match #1:

C:\Users\aballman.GRAMMATECH\Desktop\test.c:2:11: note: "root" binds here

  int i = 1.0f;
          ^~~~

1 match.


Repository:
  rC Clang

https://reviews.llvm.org/D44729





More information about the cfe-commits mailing list