From 25723ce6fce0a96e1a126502aab684e2c238f571 Mon Sep 17 00:00:00 2001 From: Enea Zaffanella Date: Fri, 19 Jul 2013 18:02:36 +0000 Subject: Fix source range of implicitly instantiated friend declaration. llvm-svn: 186702 --- clang/unittests/AST/SourceLocationTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/unittests/AST/SourceLocationTest.cpp') diff --git a/clang/unittests/AST/SourceLocationTest.cpp b/clang/unittests/AST/SourceLocationTest.cpp index 49ecfd3c981..d45c6448c79 100644 --- a/clang/unittests/AST/SourceLocationTest.cpp +++ b/clang/unittests/AST/SourceLocationTest.cpp @@ -244,5 +244,18 @@ TEST(UnresolvedUsingValueDecl, SourceRange) { unresolvedUsingValueDecl())); } +TEST(FriendDecl, InstantiationSourceRange) { + RangeVerifier Verifier; + Verifier.expectRange(4, 3, 4, 35); + EXPECT_TRUE(Verifier.match( + "template class S;\n" + "template void operator+(S x);\n" + "template struct S {\n" + " friend void operator+<>(S src);\n" + "};\n" + "void test(S s) { +s; }", + friendDecl(hasParent(recordDecl(isTemplateInstantiation()))))); +} + } // end namespace ast_matchers } // end namespace clang -- cgit v1.2.3