[PATCH] D20687: [ASTMatchers] Make isNoThrow and hasDynamicExceptionSpec polymorphic for use with both functionDecl and functionProtoType

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 6 09:11:13 PDT 2016


aaron.ballman added a comment.

This is looking good, aside from a few small nits. The only question I have remaining is whether this should be on FunctionProtoType or FunctionType? I think being on FunctionProtoType (how you have it) is preferable. @sbenza or @klimek, do you agree?


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:3254
@@ -3252,1 +3253,3 @@
+                                                        FunctionProtoType)) {
+  if (const auto *FnTy = internal::getFunctionProtoType(Node))
     return FnTy->hasDynamicExceptionSpec();
----------------
Since the type isn't explicitly spelled out in the initialization, probably should use `const FunctionProtoType *` instead of `const auto *`.

================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:3274
@@ -3270,1 +3273,3 @@
+                                                        FunctionProtoType)) {
+  const auto *FnTy = internal::getFunctionProtoType(Node);
 
----------------
Same here.


http://reviews.llvm.org/D20687





More information about the cfe-commits mailing list