When a friend is declared in a dependent context, don't even try to
match it up with a declaration in the outer scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85628 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index f511eb1..f8f2217 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -434,9 +434,10 @@
// Trigger creation of the type for the instantiation.
SemaRef.Context.getTypeDeclType(RecordInst);
- // We're done with friends now.
- if (Inst->getFriendObjectKind())
+ // Finish handling of friends.
+ if (Inst->getFriendObjectKind()) {
return Inst;
+ }
Owner->addDecl(Inst);