]> granicus.if.org Git - clang/commitdiff
Switch a few CXXScopeSpec::MakeTrivial() calls over to appropriate
authorDouglas Gregor <dgregor@apple.com>
Fri, 25 Feb 2011 16:07:42 +0000 (16:07 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 25 Feb 2011 16:07:42 +0000 (16:07 +0000)
NestedNameSpecifierLoc handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaTemplate.cpp

index 304cfd13e1a84cb91f8b615d1f93d2e16d628fa8..d58a47ab45a22d67f16401fa2eb5085353d09e02 100644 (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) {
index 5b09dfcee1572b1029b9529d4ec19ea0463da4dd..446eb9ed6d472e8eddf494e27bffa3c445950f5f 100644 (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;
 }