From 6dd62fd99d6e2227de4adfc7429ed14ffca6f180 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 May 2012 23:51:36 +0000 Subject: RecursiveASTVisitor: We don't create any declaration to mark the explicit instantiation of function templates other than the instantiation itself, so visit that when traversing the function template decl. This is a temporary fix, pending the creation of a Decl node to represent the explicit instantiation. Patch by Daniel Jasper! llvm-svn: 156522 --- clang/unittests/Tooling/RecursiveASTVisitorTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'clang/unittests/Tooling/RecursiveASTVisitorTest.cpp') diff --git a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp index 953817e61fb..a26c9f3cb73 100644 --- a/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp +++ b/clang/unittests/Tooling/RecursiveASTVisitorTest.cpp @@ -301,6 +301,19 @@ TEST(RecursiveASTVisitor, VisitsCallInPartialTemplateSpecialization) { "}\n")); } +TEST(RecursiveASTVisitor, VisitsExplicitTemplateSpecialization) { + CXXMemberCallVisitor Visitor; + Visitor.ExpectMatch("A::f", 4, 5); + EXPECT_TRUE(Visitor.runOver( + "struct A {\n" + " void f() const {}\n" + " template void g(const T& t) const {\n" + " t.f();\n" + " }\n" + "};\n" + "template void A::g(const A& a) const;\n")); +} + TEST(RecursiveASTVisitor, VisitsPartialTemplateSpecialization) { // From cfe-commits/Week-of-Mon-20100830/033998.html // Contrary to the approach sugggested in that email, we visit all -- cgit v1.2.3