[PATCH] D20052: Add new ASTMatcher that matches dynamic exception specifications.

don hinton via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 11:36:21 PDT 2016


hintonda added inline comments.

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:3229
@@ +3228,3 @@
+///   matches the declarations of j, k, and l, but not f, g, h, or i.
+AST_MATCHER(FunctionDecl, hasDynamicExceptionSpec) {
+  if (const auto *FnTy = Node.getType()->getAs<FunctionProtoType>())
----------------
aaron.ballman wrote:
> It's a bit odd to expose this on the declaration instead of the type since the AST carries this information on the type, not the declaration. I definitely see the utility in not having to go from the decl to the type in an AST matcher, though. Can you expose it on both FunctionDecl and FunctionProtoType instead?
It's modeled on the isNoThrow matcher directly below which used FunctionDecl, so I used it for this one too.

Did you want me change this one to use FunctionProtoType or add 2 matchers, one using FunctionDecl and another one using FunctionProtoType?


http://reviews.llvm.org/D20052





More information about the cfe-commits mailing list