diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-08-12 11:46:03 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2010-08-12 11:46:03 +0000 |
commit | ef3dce817d43faadbf21ce9102d33a9d84b02e09 (patch) | |
tree | a7c5fd0d8c6d46bc8876c1495d96541a4448c02d /lib/Sema/SemaDeclCXX.cpp | |
parent | 2a479929f70d32f626778ef6e70ef46d3a37f74e (diff) |
Added locations and type source info for DeclarationName inside UsingDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 4156df0772..c27ca913c0 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3476,8 +3476,9 @@ Sema::DeclPtrTy Sema::ActOnUsingDeclaration(Scope *S, << SourceRange(Name.TemplateId->LAngleLoc, Name.TemplateId->RAngleLoc); return DeclPtrTy(); } - - DeclarationName TargetName = GetNameFromUnqualifiedId(Name).getName(); + + DeclarationNameInfo TargetNameInfo = GetNameFromUnqualifiedId(Name); + DeclarationName TargetName = TargetNameInfo.getName(); if (!TargetName) return DeclPtrTy(); @@ -3493,8 +3494,7 @@ Sema::DeclPtrTy Sema::ActOnUsingDeclaration(Scope *S, } NamedDecl *UD = BuildUsingDeclaration(S, AS, UsingLoc, SS, - Name.getSourceRange().getBegin(), - TargetName, AttrList, + TargetNameInfo, AttrList, /* IsInstantiation */ false, IsTypeName, TypenameLoc); if (UD) @@ -3743,13 +3743,13 @@ void Sema::HideUsingShadowDecl(Scope *S, UsingShadowDecl *Shadow) { NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, SourceLocation UsingLoc, CXXScopeSpec &SS, - SourceLocation IdentLoc, - DeclarationName Name, + const DeclarationNameInfo &NameInfo, AttributeList *AttrList, bool IsInstantiation, bool IsTypeName, SourceLocation TypenameLoc) { assert(!SS.isInvalid() && "Invalid CXXScopeSpec."); + SourceLocation IdentLoc = NameInfo.getLoc(); assert(IdentLoc.isValid() && "Invalid TargetName location."); // FIXME: We ignore attributes for now. @@ -3761,7 +3761,7 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, } // Do the redeclaration lookup in the current scope. - LookupResult Previous(*this, Name, IdentLoc, LookupUsingDeclName, + LookupResult Previous(*this, NameInfo, LookupUsingDeclName, ForRedeclaration); Previous.setHideTags(false); if (S) { @@ -3800,15 +3800,15 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, D = UnresolvedUsingTypenameDecl::Create(Context, CurContext, UsingLoc, TypenameLoc, SS.getRange(), NNS, - IdentLoc, Name); + IdentLoc, NameInfo.getName()); } else { D = UnresolvedUsingValueDecl::Create(Context, CurContext, - UsingLoc, SS.getRange(), NNS, - IdentLoc, Name); + UsingLoc, SS.getRange(), + NNS, NameInfo); } } else { - D = UsingDecl::Create(Context, CurContext, IdentLoc, - SS.getRange(), UsingLoc, NNS, Name, + D = UsingDecl::Create(Context, CurContext, + SS.getRange(), UsingLoc, NNS, NameInfo, IsTypeName); } D->setAccess(AS); @@ -3824,7 +3824,7 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, // Look up the target name. - LookupResult R(*this, Name, IdentLoc, LookupOrdinaryName); + LookupResult R(*this, NameInfo, LookupOrdinaryName); // Unlike most lookups, we don't always want to hide tag // declarations: tag names are visible through the using declaration @@ -3837,7 +3837,7 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS, if (R.empty()) { Diag(IdentLoc, diag::err_no_member) - << Name << LookupContext << SS.getRange(); + << NameInfo.getName() << LookupContext << SS.getRange(); UD->setInvalidDecl(); return UD; } |