Switch a few CXXScopeSpec::MakeTrivial() calls over to appropriate

NestedNameSpecifierLoc handling.

llvm-svn: 126486
This commit is contained in:
Douglas Gregor 2011-02-25 16:07:42 +00:00
parent 0499ab6c35
commit 1017641937
2 changed files with 9 additions and 7 deletions

View File

@ -107,7 +107,7 @@ ParsedType Sema::getDestructorName(SourceLocation TildeLoc,
// Nothing left to do.
} else if (LookAtPrefix && (Prefix = NNS->getPrefix())) {
CXXScopeSpec PrefixSS;
PrefixSS.MakeTrivial(Context, Prefix, SS.getRange());
PrefixSS.Adopt(NestedNameSpecifierLoc(Prefix, SS.location_data()));
LookupCtx = computeDeclContext(PrefixSS, EnteringContext);
isDependent = isDependentScopeSpecifier(PrefixSS);
} else if (ObjectTypePtr) {

View File

@ -6167,16 +6167,18 @@ ExprResult Sema::RebuildExprInCurrentInstantiation(Expr *E) {
}
bool Sema::RebuildNestedNameSpecifierInCurrentInstantiation(CXXScopeSpec &SS) {
if (SS.isInvalid()) return true;
if (SS.isInvalid())
return true;
NestedNameSpecifier *NNS = static_cast<NestedNameSpecifier*>(SS.getScopeRep());
NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
CurrentInstantiationRebuilder Rebuilder(*this, SS.getRange().getBegin(),
DeclarationName());
NestedNameSpecifier *Rebuilt =
Rebuilder.TransformNestedNameSpecifier(NNS, SS.getRange());
if (!Rebuilt) return true;
NestedNameSpecifierLoc Rebuilt
= Rebuilder.TransformNestedNameSpecifierLoc(QualifierLoc);
if (!Rebuilt)
return true;
SS.MakeTrivial(Context, Rebuilt, SS.getRange());
SS.Adopt(Rebuilt);
return false;
}