[PATCH] D16526: Add hasRetValue narrowing matcher for returnStmt

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 24 14:12:18 PST 2016


aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.

I get the same behavior from the existing has() matcher -- how is this meant to differ?

clang-query> match returnStmt(unless(has(expr())))

Match #1:

E:\Desktop\test4.cpp:2:3: note: "root" binds here

  return;
  ^~~~~~

clang-query> match returnStmt(has(expr(cxxBoolLiteral())))

Match #1:

E:\Desktop\test4.cpp:18:3: note: "root" binds here

  return true;
  ^~~~~~~~~~~

1 match.


http://reviews.llvm.org/D16526





More information about the cfe-commits mailing list