Changes:
- add an ast matcher for deductiong guide.
- allow isExplicit matcher for deductiong guide.
- add hasExplicitSpecifier matcher which give access to the expression of the explicit specifier if present.
Differential D61552
[clang] Adapt ASTMatcher to explicit(bool) specifier Tyker on May 4 2019, 5:57 AM. Authored by
Details Changes:
Diff Detail Event TimelineComment Actions This seems reasonable to me, but I'll leave it to @klimek or someone else to judge whether the isExplicit / hasExplicitSpecifier approach is the right way to expose this functionality to matcher users. Comment Actions You should also regenerate the documentation by running clang/docs/tools/dump_ast_matchers.py.
Comment Actions 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. hasExplicitSpecifier now gives access to the expression if present. Comment Actions Are you getting errors from running it, or just incorrect output?
Comment Actions fixed requested changes.
the issue happens to me even on master so i suppose the input is correct. [tyker@tyker tools]$ ./dump_ast_matchers.py *** Unparsable: " #ifndef LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H #define LLVM_CLANG_ASTMATCHERS_ASTMATCHERS_H " *** *** Unparsable: " #include "clang/AST/ASTContext.h" #include "clang/AST/ASTTypeTraits.h" #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/OpenMPClause.h" #include "clang/AST/OperationKinds.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtCXX.h" #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtOpenMP.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/TemplateName.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/ASTMatchers/ASTMatchersInternal.h" #include "clang/ASTMatchers/ASTMatchersMacros.h" #include "clang/Basic/AttrKinds.h" #include "clang/Basic/ExceptionSpecificationType.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TypeTraits.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Regex.h" #include <cassert> #include <cstddef> #include <iterator> #include <limits> #include <string> #include <utility> #include <vector> " *** *** Unparsable: " namespace clang {" *** *** Unparsable: " using DeclarationMatcher = internal::Matcher<Decl>;" *** *** Unparsable: " using StatementMatcher = internal::Matcher<Stmt>;" *** *** Unparsable: " using TypeMatcher = internal::Matcher<QualType>;" *** *** Unparsable: " using TypeLocMatcher = internal::Matcher<TypeLoc>;" *** *** Unparsable: " using NestedNameSpecifierMatcher = internal::Matcher<NestedNameSpecifier>;" *** *** Unparsable: " using NestedNameSpecifierLocMatcher = internal::Matcher<NestedNameSpecifierLoc>;" *** *** Unparsable: " using CXXCtorInitializerMatcher = internal::Matcher<CXXCtorInitializer>;" *** Probing https://clang.llvm.org/doxygen/classclang_1_1Decl.html... after this the script keep probing with no issues. Comment Actions That output matches what I get, and my docs generate for me. Are you sure the .html file is not being generated properly for you? Comment Actions i was confuse because the log seemed like an error and it was happening in python2.7 and python3.7 it works in python2.7.
Comment Actions LGTM aside from a documentation nit.
|
Including implicit deduction guides? Might be worth clarifying that.