aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXScopeSpec.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-02 08:25:40 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-02 08:25:40 +0000
commit1bcee0a5a29981f8c78a8620d1c78841dbc5c348 (patch)
treef405434b0c3717a4c586c06e49b5c86c89758270 /lib/Sema/SemaCXXScopeSpec.cpp
parent666571afadd9dc472da9696377a05b50c9b3f2ab (diff)
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
Diffstat (limited to 'lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp
index 34a5b784d4..14db77440f 100644
--- a/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/lib/Sema/SemaCXXScopeSpec.cpp
@@ -313,7 +313,10 @@ NamedDecl *Sema::FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS) {
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 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S,
}
// 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 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S,
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 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S,
// 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();