@@ -556,6 +556,22 @@ TEST_P(ASTMatchersTest, DeclRefExpr) {
556
556
Reference));
557
557
}
558
558
559
+ TEST_P (ASTMatchersTest, DependentScopeDeclRefExpr) {
560
+ if (!GetParam ().isCXX () || GetParam ().hasDelayedTemplateParsing ()) {
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
+
559
575
TEST_P (ASTMatchersTest, CXXMemberCallExpr) {
560
576
if (!GetParam ().isCXX ()) {
561
577
return ;
@@ -629,10 +645,8 @@ TEST_P(ASTMatchersTest, MemberExpr_MatchesVariable) {
629
645
EXPECT_TRUE (matches (" template <class T>"
630
646
" class X : T { void f() { this->T::v; } };" ,
631
647
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 ()));
636
650
EXPECT_TRUE (matches (" template <class T> void x() { T t; t.v; }" ,
637
651
cxxDependentScopeMemberExpr ()));
638
652
}
0 commit comments