diff options
author | John McCall <rjmccall@apple.com> | 2009-11-18 02:36:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-11-18 02:36:19 +0000 |
commit | 7ba107a1863ddfa1664555854f0d7bdb3c491c92 (patch) | |
tree | f0d6842fdd852e98703fce9d62f092d4802dbbec /lib/Sema/SemaDecl.cpp | |
parent | 1d5fdf3d3b5ea2640ebe8673814a0b6ab7cf5eb2 (diff) |
Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 2228b41b33..3f204983a3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -94,6 +94,7 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, switch (Result.getResultKind()) { case LookupResult::NotFound: case LookupResult::FoundOverloaded: + case LookupResult::FoundUnresolvedValue: return 0; case LookupResult::Ambiguous: @@ -166,6 +167,10 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, } else if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(IIDecl)) { T = Context.getObjCInterfaceType(IDecl); + } else if (UnresolvedUsingTypenameDecl *UUDecl = + dyn_cast<UnresolvedUsingTypenameDecl>(IIDecl)) { + // FIXME: preserve source structure information. + T = Context.getTypenameType(UUDecl->getTargetNestedNameSpecifier(), &II); } else { // If it's not plausibly a type, suppress diagnostics. Result.suppressDiagnostics(); @@ -2446,7 +2451,9 @@ void Sema::CheckVariableDeclaration(VarDecl *NewVD, NamedDecl *PrevDecl, } static bool isUsingDecl(Decl *D) { - return isa<UsingDecl>(D) || isa<UnresolvedUsingDecl>(D); + return isa<UsingDecl>(D) || + isa<UnresolvedUsingTypenameDecl>(D) || + isa<UnresolvedUsingValueDecl>(D); } /// \brief Data used with FindOverriddenMethod |