[PATCH] D61552: [clang] Adapt ASTMatcher to explicit(bool) specifier

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 17 08:42:58 PDT 2019


aaron.ballman added a comment.

In D61552#1530730 <https://reviews.llvm.org/D61552#1530730>, @Tyker wrote:

> i didn't manage to get "clang/docs/tools/dump_ast_matchers.py" to work. it keep failing to parse and generating empty files as a result.


Are you getting errors from running it, or just incorrect output?



================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6190
+/// cxxDeductionGuideDecl(isExplicit()) will match #6, but not #5.
+/// cxxConstructorDecl(isExplicit()) will match #8, but not #7 or #9.
+AST_POLYMORPHIC_MATCHER(isExplicit, AST_POLYMORPHIC_SUPPORTED_TYPES(
----------------
Why won't it match #2?


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6220
+/// #6.
+AST_MATCHER_P(FunctionDecl, hasExplicitExpr, internal::Matcher<Expr>,
+              InnerMatcher) {
----------------
Not keen on the name `hasExplicitExpr` -- I think `hasExplicitSpecifier()` would be a more intuitive name.


================
Comment at: clang/lib/ASTMatchers/Dynamic/Registry.cpp:171
   REGISTER_MATCHER(cxxConversionDecl);
+  REGISTER_MATCHER(cxxDeductionGuideDecl);
   REGISTER_MATCHER(cxxCtorInitializer);
----------------
Please sort alphabetically.


================
Comment at: clang/lib/ASTMatchers/Dynamic/Registry.cpp:263
   REGISTER_MATCHER(hasDeducedType);
+  REGISTER_MATCHER(hasExplicitExpr);
   REGISTER_MATCHER(hasDefaultArgument);
----------------
Please sort alphabetically.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61552/new/

https://reviews.llvm.org/D61552





More information about the cfe-commits mailing list