@@ -556,6 +556,22 @@ TEST_P(ASTMatchersTest, DeclRefExpr) {
556556 Reference));
557557}
558558
559+ TEST_P (ASTMatchersTest, DependentScopeDeclRefExpr) {
560+ if (!GetParam ().isCXX ()) {
561+ // FIXME: Add a test for `dependentScopeDeclRefExpr()` that does not depend
562+ // on C++.
563+ return ;
564+ }
565+
566+ EXPECT_TRUE (matches (" template <class T> class X : T { void f() { T::v; } };" ,
567+ dependentScopeDeclRefExpr ()));
568+
569+ EXPECT_TRUE (
570+ matches (" template <typename T> struct S { static T Foo; };"
571+ " template <typename T> void declToImport() { (void)S<T>::Foo; }" ,
572+ dependentScopeDeclRefExpr ()));
573+ }
574+
559575TEST_P (ASTMatchersTest, CXXMemberCallExpr) {
560576 if (!GetParam ().isCXX ()) {
561577 return ;
@@ -629,10 +645,8 @@ TEST_P(ASTMatchersTest, MemberExpr_MatchesVariable) {
629645 EXPECT_TRUE (matches (" template <class T>"
630646 " class X : T { void f() { this->T::v; } };" ,
631647 cxxDependentScopeMemberExpr ()));
632- // FIXME: Add a matcher for DependentScopeDeclRefExpr.
633- EXPECT_TRUE (
634- notMatches (" template <class T> class X : T { void f() { T::v; } };" ,
635- cxxDependentScopeMemberExpr ()));
648+ EXPECT_TRUE (matches (" template <class T> class X : T { void f() { T::v; } };" ,
649+ dependentScopeDeclRefExpr ()));
636650 EXPECT_TRUE (matches (" template <class T> void x() { T t; t.v; }" ,
637651 cxxDependentScopeMemberExpr ()));
638652}
0 commit comments