aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-04 17:00:24 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-04 17:00:24 +0000
commitb696ea3a0693798daeafd896d77f0b8f1fec3cc5 (patch)
treeb0d300f2f25fe4de861bacc0011a4ed2110ecb49 /lib/Sema/SemaDecl.cpp
parentf680a0fe2dcab32b59fe6fdf71145b5313c40950 (diff)
Diagnose ambiguities in getTypeName. Fixes http://llvm.org/bugs/show_bug.cgi?id=3475
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 66b72ecad4..fbf4be79eb 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -30,21 +30,21 @@
using namespace clang;
-Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, Scope *S,
- const CXXScopeSpec *SS) {
+Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
+ Scope *S, const CXXScopeSpec *SS) {
Decl *IIDecl = 0;
LookupResult Result = LookupParsedName(S, SS, &II, LookupOrdinaryName, false);
switch (Result.getKind()) {
case LookupResult::NotFound:
case LookupResult::FoundOverloaded:
+ return 0;
+
case LookupResult::AmbiguousBaseSubobjectTypes:
case LookupResult::AmbiguousBaseSubobjects:
- // FIXME: In the event of an ambiguous lookup, we could visit all of
- // the entities found to determine whether they are all types. This
- // might provide better diagnostics.
case LookupResult::AmbiguousReference:
- // FIXME: We need source location of identifier to diagnose more correctly.
+ DiagnoseAmbiguousLookup(Result, DeclarationName(&II), NameLoc);
return 0;
+
case LookupResult::Found:
IIDecl = Result.getAsDecl();
break;