aboutsummaryrefslogtreecommitdiff
path: root/include/clang/ASTMatchers
diff options
context:
space:
mode:
authorShuai Wang <shuaiwang@google.com>2018-09-17 18:48:43 +0000
committerShuai Wang <shuaiwang@google.com>2018-09-17 18:48:43 +0000
commit926e91b0e6be63d21bd89ea9a1cc5ca17d0f3528 (patch)
treeeb943321f0caa886526409f417f47fe27c1c2e52 /include/clang/ASTMatchers
parentf98dc5ceb32e4482f4d89194a3808dc61d7da49f (diff)
[ASTMatchers] Let isArrow also support UnresolvedMemberExpr, CXXDependentScopeMemberExpr
Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/ASTMatchers')
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index 500d0a6670..50aa63cd95 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -4697,13 +4697,24 @@ AST_MATCHER(CXXMethodDecl, isUserProvided) {
/// \code
/// class Y {
/// void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; }
+/// template <class T> void f() { this->f<T>(); f<T>(); }
/// int a;
/// static int b;
/// };
+/// template <class T>
+/// class Z {
+/// void x() { this->m; }
+/// };
/// \endcode
/// memberExpr(isArrow())
/// matches this->x, x, y.x, a, this->b
-AST_MATCHER(MemberExpr, isArrow) {
+/// cxxDependentScopeMemberExpr(isArrow())
+/// matches this->m
+/// unresolvedMemberExpr(isArrow())
+/// matches this->f<T>, f<T>
+AST_POLYMORPHIC_MATCHER(
+ isArrow, AST_POLYMORPHIC_SUPPORTED_TYPES(MemberExpr, UnresolvedMemberExpr,
+ CXXDependentScopeMemberExpr)) {
return Node.isArrow();
}