aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 113283a644..e7a327805a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4329,13 +4329,13 @@ CreateNewDecl:
// If this has an identifier, add it to the scope stack.
if (TUK == TUK_Friend) {
+ // We might be replacing an existing declaration in the lookup tables;
+ // if so, borrow its access specifier.
+ if (PrevDecl)
+ New->setAccess(PrevDecl->getAccess());
+
// Friend tag decls are visible in fairly strange ways.
if (!CurContext->isDependentContext()) {
- // We might be replacing an existing declaration in the lookup tables;
- // if so, borrow its access specifier.
- if (PrevDecl)
- New->setAccess(PrevDecl->getAccess());
-
DeclContext *DC = New->getDeclContext()->getLookupContext();
DC->makeDeclVisibleInContext(New, /* Recoverable = */ false);
if (Scope *EnclosingScope = getScopeForDeclContext(S, DC))