summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index 537ffbb8964..39a5d577291 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -765,6 +765,11 @@ TEST(IsArrow, MatchesMemberVariablesViaArrow) {
memberExpr(isArrow())));
EXPECT_TRUE(notMatches("class Y { void x() { (*this).y; } int y; };",
memberExpr(isArrow())));
+ EXPECT_TRUE(matches("template <class T> class Y { void x() { this->m; } };",
+ cxxDependentScopeMemberExpr(isArrow())));
+ EXPECT_TRUE(
+ notMatches("template <class T> class Y { void x() { (*this).m; } };",
+ cxxDependentScopeMemberExpr(isArrow())));
}
TEST(IsArrow, MatchesStaticMemberVariablesViaArrow) {
@@ -783,6 +788,14 @@ TEST(IsArrow, MatchesMemberCallsViaArrow) {
memberExpr(isArrow())));
EXPECT_TRUE(notMatches("class Y { void x() { Y y; y.x(); } };",
memberExpr(isArrow())));
+ EXPECT_TRUE(
+ matches("class Y { template <class T> void x() { this->x<T>(); } };",
+ unresolvedMemberExpr(isArrow())));
+ EXPECT_TRUE(matches("class Y { template <class T> void x() { x<T>(); } };",
+ unresolvedMemberExpr(isArrow())));
+ EXPECT_TRUE(
+ notMatches("class Y { template <class T> void x() { (*this).x<T>(); } };",
+ unresolvedMemberExpr(isArrow())));
}
TEST(ConversionDeclaration, IsExplicit) {
OpenPOWER on IntegriCloud