diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 16fd28e..9b607e7 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -920,7 +920,8 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
     // function templates hide function templates with different
     // return types or template parameter lists.
     bool UseMemberUsingDeclRules =
-      (OldIsUsingDecl || NewIsUsingDecl) && CurContext->isRecord();
+      (OldIsUsingDecl || NewIsUsingDecl) && CurContext->isRecord() &&
+      !New->getFriendObjectKind();
 
     if (FunctionTemplateDecl *OldT = dyn_cast<FunctionTemplateDecl>(OldD)) {
       if (!IsOverload(New, OldT->getTemplatedDecl(), UseMemberUsingDeclRules)) {
diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp
index c5b11eb..5263447 100644
--- a/test/SemaCXX/friend.cpp
+++ b/test/SemaCXX/friend.cpp
@@ -138,3 +138,9 @@ namespace test7 {
     };
   }
 }
+
+namespace test8 {
+  struct A { void f(); }; // expected-note {{target of using declaration}}
+  struct B : public A { using A::f; }; // expected-note {{using declaration}}
+  struct C { friend void B::f(); }; // expected-error {{declaration conflicts with target of using declaration already in scope}}
+}
