diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-28 21:09:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-28 21:09:48 +0000 |
commit | 5ec178ff237d77e7acf5e747c19bf4f2de77a779 (patch) | |
tree | f3d0a24c570d3aa228bec174a79f87ed3c8f2745 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 357bbd022c1d340c8e255aea7a684ddb34bc76e5 (diff) |
Fix and test template instantiation for nested member templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 213855741c..732394d867 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -947,9 +947,12 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, // Find the function body that we'll be substituting. const FunctionDecl *PatternDecl = 0; - if (FunctionTemplateDecl *Primary = Function->getPrimaryTemplate()) + if (FunctionTemplateDecl *Primary = Function->getPrimaryTemplate()) { + while (Primary->getInstantiatedFromMemberTemplate()) + Primary = Primary->getInstantiatedFromMemberTemplate(); + PatternDecl = Primary->getTemplatedDecl(); - else + } else PatternDecl = Function->getInstantiatedFromMemberFunction(); Stmt *Pattern = 0; if (PatternDecl) |