diff options
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 304cfd13e1..d58a47ab45 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -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) { diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 5b09dfcee1..446eb9ed6d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -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; } |