Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to
return null on overloaded results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp
index 34a5b78..14db774 100644
--- a/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/lib/Sema/SemaCXXScopeSpec.cpp
@@ -313,7 +313,10 @@
LookupName(Found, S);
assert(!Found.isAmbiguous() && "Cannot handle ambiguities here yet");
- NamedDecl *Result = Found.getAsSingleDecl(Context);
+ if (!Found.isSingleResult())
+ return 0;
+
+ NamedDecl *Result = Found.getFoundDecl();
if (isAcceptableNestedNameSpecifier(Result))
return Result;
@@ -414,7 +417,7 @@
}
// FIXME: Deal with ambiguities cleanly.
- NamedDecl *SD = Found.getAsSingleDecl(Context);
+ NamedDecl *SD = Found.getAsSingle<NamedDecl>();
if (isAcceptableNestedNameSpecifier(SD)) {
if (!ObjectType.isNull() && !ObjectTypeSearchedInScope) {
// C++ [basic.lookup.classref]p4:
@@ -429,7 +432,7 @@
if (S) {
LookupResult FoundOuter(*this, &II, IdLoc, LookupNestedNameSpecifierName);
LookupName(FoundOuter, S);
- OuterDecl = FoundOuter.getAsSingleDecl(Context);
+ OuterDecl = FoundOuter.getAsSingle<NamedDecl>();
} else
OuterDecl = ScopeLookupResult;
@@ -469,14 +472,13 @@
// If we didn't find anything during our lookup, try again with
// ordinary name lookup, which can help us produce better error
// messages.
- if (!SD) {
+ if (Found.empty()) {
Found.clear(LookupOrdinaryName);
LookupName(Found, S);
- SD = Found.getAsSingleDecl(Context);
}
unsigned DiagID;
- if (SD)
+ if (!Found.empty())
DiagID = diag::err_expected_class_or_namespace;
else if (SS.isSet()) {
Diag(IdLoc, diag::err_no_member) << &II << LookupCtx << SS.getRange();