diff options
Diffstat (limited to 'clang/unittests/AST/ASTContextParentMapTest.cpp')
-rw-r--r-- | clang/unittests/AST/ASTContextParentMapTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/AST/ASTContextParentMapTest.cpp b/clang/unittests/AST/ASTContextParentMapTest.cpp index 94e9735654c..b1d7db4164e 100644 --- a/clang/unittests/AST/ASTContextParentMapTest.cpp +++ b/clang/unittests/AST/ASTContextParentMapTest.cpp @@ -38,6 +38,19 @@ TEST(GetParents, ReturnsParentForStmt) { ifStmt(hasParent(compoundStmt())))); } +TEST(GetParents, ReturnsParentForTypeLoc) { + MatchVerifier<TypeLoc> Verifier; + EXPECT_TRUE( + Verifier.match("namespace a { class b {}; } void f(a::b) {}", + typeLoc(hasParent(typeLoc(hasParent(functionDecl())))))); +} + +TEST(GetParents, ReturnsParentForNestedNameSpecifierLoc) { + MatchVerifier<NestedNameSpecifierLoc> Verifier; + EXPECT_TRUE(Verifier.match("namespace a { class b {}; } void f(a::b) {}", + nestedNameSpecifierLoc(hasParent(typeLoc())))); +} + TEST(GetParents, ReturnsParentInsideTemplateInstantiations) { MatchVerifier<Decl> DeclVerifier; EXPECT_TRUE(DeclVerifier.match( |