diff options
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index b6983052dd8..ab1997ab0f3 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -4217,6 +4217,14 @@ TEST(HasAncestor, MatchesAllAncestors) { hasAncestor(cxxRecordDecl(unless(isTemplateInstantiation()))))))); } +TEST(HasAncestor, ImplicitArrayCopyCtorDeclRefExpr) { + EXPECT_TRUE(matches("struct MyClass {\n" + " int c[1];\n" + " static MyClass Create() { return MyClass(); }\n" + "};", + declRefExpr(to(decl(hasAncestor(decl())))))); +} + TEST(HasParent, MatchesAllParents) { EXPECT_TRUE(matches( "template <typename T> struct C { static void f() { 42; } };" |