@@ -556,6 +556,21 @@ TEST_P(ASTMatchersTest, DeclRefExpr) {
556556 Reference));
557557}
558558
559+ TEST_P (ASTMatchersTest, DependentScopeDeclRefExpr) {
560+ if (!GetParam ().isCXX () || GetParam ().hasDelayedTemplateParsing ()) {
561+ // FIXME: Fix this test to work with delayed template parsing.
562+ return ;
563+ }
564+
565+ EXPECT_TRUE (matches (" template <class T> class X : T { void f() { T::v; } };" ,
566+ dependentScopeDeclRefExpr ()));
567+
568+ EXPECT_TRUE (
569+ matches (" template <typename T> struct S { static T Foo; };"
570+ " template <typename T> void declToImport() { (void)S<T>::Foo; }" ,
571+ dependentScopeDeclRefExpr ()));
572+ }
573+
559574TEST_P (ASTMatchersTest, CXXMemberCallExpr) {
560575 if (!GetParam ().isCXX ()) {
561576 return ;
@@ -629,10 +644,8 @@ TEST_P(ASTMatchersTest, MemberExpr_MatchesVariable) {
629644 EXPECT_TRUE (matches (" template <class T>"
630645 " class X : T { void f() { this->T::v; } };" ,
631646 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 ()));
647+ EXPECT_TRUE (matches (" template <class T> class X : T { void f() { T::v; } };" ,
648+ dependentScopeDeclRefExpr ()));
636649 EXPECT_TRUE (matches (" template <class T> void x() { T t; t.v; }" ,
637650 cxxDependentScopeMemberExpr ()));
638651}
0 commit comments