aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaOverload.cpp4
-rw-r--r--test/SemaCXX/friend.cpp8
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 440f5acdbc..4c843ea738 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -584,10 +584,12 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
Match = *I;
return Ovl_Match;
}
- } else if (isa<UsingDecl>(OldD) || isa<TagDecl>(OldD)) {
+ } else if (isa<UsingDecl>(OldD)) {
// We can overload with these, which can show up when doing
// redeclaration checks for UsingDecls.
assert(Old.getLookupKind() == LookupUsingDeclName);
+ } else if (isa<TagDecl>(OldD)) {
+ // We can always overload with tags by hiding them.
} else if (isa<UnresolvedUsingValueDecl>(OldD)) {
// Optimistically assume that an unresolved using decl will
// overload; if it doesn't, we'll have to diagnose during
diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp
index e35c500e9a..939d3ae456 100644
--- a/test/SemaCXX/friend.cpp
+++ b/test/SemaCXX/friend.cpp
@@ -71,3 +71,11 @@ struct B : A
template<int> friend A::~A(); // expected-error {{does not match}}
};
}
+
+// PR7915
+namespace test5 {
+ struct A;
+ struct A1 { friend void A(); };
+
+ struct B { friend void B(); };
+}