From c70b2519d5a9d1e612674bd78cb70ec350b101d1 Mon Sep 17 00:00:00 2001 From: Enea Zaffanella Date: Wed, 17 Jul 2013 17:28:56 +0000 Subject: Fixed source range of C++03 access declarations. llvm-svn: 186522 --- clang/unittests/AST/SourceLocationTest.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'clang/unittests/AST/SourceLocationTest.cpp') 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 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 Verifier; + Verifier.expectRange(3, 3, 3, 6); + EXPECT_TRUE(Verifier.match( + "template \n" + "class D : public B {\n" + " B::i;\n" + "};", + unresolvedUsingValueDecl())); +} + } // end namespace ast_matchers } // end namespace clang -- cgit v1.2.3