diff options
author | John McCall <rjmccall@apple.com> | 2009-12-14 23:19:40 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-14 23:19:40 +0000 |
commit | 2079d0b9747fb944ab4bb8abbd649ce55ffd1713 (patch) | |
tree | 978263820013d17578c72e86de791407c2423cd5 /clang/lib | |
parent | 2e1cf199247ca55df60aaf1cd8a5f3e1134fec32 (diff) | |
download | bcm5719-llvm-2079d0b9747fb944ab4bb8abbd649ce55ffd1713.tar.gz bcm5719-llvm-2079d0b9747fb944ab4bb8abbd649ce55ffd1713.zip |
Fix PR5716 by bandaging over the solution until we can come back to it.
I apologize for friend declarations.
llvm-svn: 91359
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 9c4c38a134a..8d74bd76ca5 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -627,7 +627,12 @@ TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { InstTemplate->setAccess(D->getAccess()); assert(InstTemplate && "VisitFunctionDecl/CXXMethodDecl didn't create a template!"); - if (!InstTemplate->getInstantiatedFromMemberTemplate()) + + // Link the instantiation back to the pattern *unless* this is a + // non-definition friend declaration. + if (!InstTemplate->getInstantiatedFromMemberTemplate() && + !(InstTemplate->getFriendObjectKind() && + !D->getTemplatedDecl()->isThisDeclarationADefinition())) InstTemplate->setInstantiatedFromMemberTemplate(D); // Add non-friends into the owner. |