summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/SourceLocationTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/AST/SourceLocationTest.cpp')
-rw-r--r--clang/unittests/AST/SourceLocationTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp
index 95ef2c425b5..49ecfd3c981 100644
--- a/clang/unittests/AST/SourceLocationTest.cpp
+++ b/clang/unittests/AST/SourceLocationTest.cpp
@@ -224,5 +224,25 @@ TEST(CXXUnresolvedConstructExpr, SourceRange) {
unresolvedConstructExpr(), Args, Lang_CXX11));
}
+TEST(UsingDecl, SourceRange) {
+ RangeVerifier<UsingDecl> Verifier;
+ Verifier.expectRange(2, 22, 2, 25);
+ EXPECT_TRUE(Verifier.match(
+ "class B { protected: int i; };\n"
+ "class D : public B { B::i; };",
+ usingDecl()));
+}
+
+TEST(UnresolvedUsingValueDecl, SourceRange) {
+ RangeVerifier<UnresolvedUsingValueDecl> Verifier;
+ Verifier.expectRange(3, 3, 3, 6);
+ EXPECT_TRUE(Verifier.match(
+ "template <typename B>\n"
+ "class D : public B {\n"
+ " B::i;\n"
+ "};",
+ unresolvedUsingValueDecl()));
+}
+
} // end namespace ast_matchers
} // end namespace clang
OpenPOWER on IntegriCloud