forked from OSchip/llvm-project
Fixed lexical declaration context when instantiating a friend / out-of-line class template member.
llvm-svn: 145146
This commit is contained in:
parent
8c8486dbb2
commit
edf99fff49
|
@ -862,9 +862,16 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
|
|||
// Finish handling of friends.
|
||||
if (isFriend) {
|
||||
DC->makeDeclVisibleInContext(Inst, /*Recoverable*/ false);
|
||||
Inst->setLexicalDeclContext(Owner);
|
||||
RecordInst->setLexicalDeclContext(Owner);
|
||||
return Inst;
|
||||
}
|
||||
|
||||
if (D->isOutOfLine()) {
|
||||
Inst->setLexicalDeclContext(D->getLexicalDeclContext());
|
||||
RecordInst->setLexicalDeclContext(D->getLexicalDeclContext());
|
||||
}
|
||||
|
||||
Owner->addDecl(Inst);
|
||||
|
||||
if (!PrevClassTemplate) {
|
||||
|
|
Loading…
Reference in New Issue