aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-30 21:07:27 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-30 21:07:27 +0000
commite8c01bdb56549adcecd71ce39160eea54b2c51c8 (patch)
tree9a535880e0d0c7475165275aabf058fe913df760 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent7c15e71fb260629e58c25798f1040e5a3305f9f6 (diff)
Instantiate class template friends better; fixes PR5332.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 0b54533175..f511eb15d2 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -425,12 +425,19 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
= ClassTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(),
D->getIdentifier(), InstParams, RecordInst, 0);
RecordInst->setDescribedClassTemplate(Inst);
- Inst->setAccess(D->getAccess());
+ if (D->getFriendObjectKind())
+ Inst->setObjectOfFriendDecl(true);
+ else
+ Inst->setAccess(D->getAccess());
Inst->setInstantiatedFromMemberTemplate(D);
// Trigger creation of the type for the instantiation.
SemaRef.Context.getTypeDeclType(RecordInst);
+ // We're done with friends now.
+ if (Inst->getFriendObjectKind())
+ return Inst;
+
Owner->addDecl(Inst);
// First, we sort the partial specializations by location, so