diff options
author | John McCall <rjmccall@apple.com> | 2009-12-17 23:21:11 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-17 23:21:11 +0000 |
commit | e129d44aab6324aa2094d68730a7843c41a4e45f (patch) | |
tree | 3e3203a394da9d454e5b9fa6b0d91d5f247eccc5 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 99860173af0b070f93558c26b78bb7ac07820370 (diff) |
Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax. This proved remarkably easy to "fix" once
I settled on how I was going to approach it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91633 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 69982be84b..2ca4810055 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -396,7 +396,13 @@ Decl *TemplateDeclInstantiator::VisitFriendDecl(FriendDecl *D) { // FIXME: We have a problem here, because the nested call to Visit(ND) // will inject the thing that the friend references into the current // owner, which is wrong. - Decl *NewND = Visit(ND); + Decl *NewND; + + // Hack to make this work almost well pending a rewrite. + if (ND->getDeclContext()->isRecord()) + NewND = SemaRef.FindInstantiatedDecl(ND, TemplateArgs); + else + NewND = Visit(ND); if (!NewND) return 0; FU = cast<NamedDecl>(NewND); |