diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-09 23:51:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-09 23:51:36 +0000 |
commit | 06cd51a83577019ea26661b7d570ae9aef06f674 (patch) | |
tree | d46fa8ff6bcba596243cf3db4beb1cf77556099f /unittests/Tooling/RecursiveASTVisitorTest.cpp | |
parent | 1de6a6cb485fb58b4fb100282bb3cf298eedacd9 (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling/RecursiveASTVisitorTest.cpp')
-rw-r--r-- | unittests/Tooling/RecursiveASTVisitorTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Tooling/RecursiveASTVisitorTest.cpp b/unittests/Tooling/RecursiveASTVisitorTest.cpp index 953817e61f..a26c9f3cb7 100644 --- a/unittests/Tooling/RecursiveASTVisitorTest.cpp +++ b/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<class T> 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 |