aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-04-03 21:19:47 +0000
committerJohn McCall <rjmccall@apple.com>2013-04-03 21:19:47 +0000
commit78037ac3e7562aa3e306eaba97f1c609b86337d9 (patch)
tree55e05cfa688d5f8b70a4174b232dca5b6e18f2d5 /lib/Sema/SemaOverload.cpp
parent08291a937a149dbd036fd6ac8ab061eb8034343d (diff)
Complain about attempts to befriend declarations via a using
declaration. Patch by Stephen Lin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 5d931cfcaf..89d495ddc1 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)) {