================ @@ -2235,6 +2235,24 @@ TEST_P(ASTMatchersTest, ArgumentCountIs_CXXConstructExpr) { Constructor1Arg)); } +TEST_P(ASTMatchersTest, HasDependentName_DependentScopeDeclRefExpr) { + if (!GetParam().isCXX() || GetParam().hasDelayedTemplateParsing()) { + // FIXME: Fix this test to work with delayed template parsing. + return; + } + + EXPECT_TRUE(matches("template <class T> class X : T { void f() { T::v; } };", + dependentScopeDeclRefExpr(hasDependentName("v")))); + + EXPECT_TRUE(matches("template <typename T> struct S { static T Foo; };" + "template <typename T> void x() { (void)S<T>::Foo; }", + dependentScopeDeclRefExpr(hasDependentName("Foo")))); + + EXPECT_TRUE(matches("template <typename T> struct S { static T foo(); };" + "template <typename T> void x() { S<T>::foo; }", ---------------- HighCommander4 wrote:
nit: it would make the example more realistic if the function is actually called, as in `S<T>::foo();` https://github.com/llvm/llvm-project/pull/121656 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits