[cfe-commits] r127159 - /cfe/trunk/lib/Sema/TreeTransform.h

Douglas Gregor dgregor at apple.com
Mon Mar 7 07:13:34 PST 2011


Author: dgregor
Date: Mon Mar  7 09:13:34 2011
New Revision: 127159

URL: http://llvm.org/viewvc/llvm-project?rev=127159&view=rev
Log:
When rebuilding a dependent template specialization type to another
dependent template specialization type, make sure to set the keyword
location. Fixes some valgrind issues introduced in r127150.

Modified:
    cfe/trunk/lib/Sema/TreeTransform.h

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=127159&r1=127158&r2=127159&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Mar  7 09:13:34 2011
@@ -4516,7 +4516,7 @@
       = TLB.push<TemplateSpecializationTypeLoc>(NamedT);
     NamedTL.setLAngleLoc(TL.getLAngleLoc());
     NamedTL.setRAngleLoc(TL.getRAngleLoc());
-    for (unsigned I = 0, E = NamedTL.getNumArgs(); I != E; ++I)
+    for (unsigned I = 0, E = NewTemplateArgs.size(); I != E; ++I)
       NamedTL.setArgLocInfo(I, NewTemplateArgs[I].getLocInfo());
     
     // Copy information relevant to the elaborated type.
@@ -4526,18 +4526,19 @@
   } else if (isa<DependentTemplateSpecializationType>(Result)) {
     DependentTemplateSpecializationTypeLoc SpecTL
       = TLB.push<DependentTemplateSpecializationTypeLoc>(Result);
+    SpecTL.setKeywordLoc(TL.getKeywordLoc());
     SpecTL.setQualifierLoc(QualifierLoc);
     SpecTL.setLAngleLoc(TL.getLAngleLoc());
     SpecTL.setRAngleLoc(TL.getRAngleLoc());
     SpecTL.setNameLoc(TL.getNameLoc());
-    for (unsigned I = 0, E = SpecTL.getNumArgs(); I != E; ++I)
+    for (unsigned I = 0, E = NewTemplateArgs.size(); I != E; ++I)
       SpecTL.setArgLocInfo(I, NewTemplateArgs[I].getLocInfo());
   } else {
     TemplateSpecializationTypeLoc SpecTL
       = TLB.push<TemplateSpecializationTypeLoc>(Result);
     SpecTL.setLAngleLoc(TL.getLAngleLoc());
     SpecTL.setRAngleLoc(TL.getRAngleLoc());
-    for (unsigned I = 0, E = SpecTL.getNumArgs(); I != E; ++I)
+    for (unsigned I = 0, E = NewTemplateArgs.size(); I != E; ++I)
       SpecTL.setArgLocInfo(I, NewTemplateArgs[I].getLocInfo());
   }
   return Result;





More information about the cfe-commits mailing list