Author: dgregor
Date: Wed Jul 22 17:05:02 2009
New Revision: 76804

URL: http://llvm.org/viewvc/llvm-project?rev=76804&view=rev
Log:
Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the 
order of evaluation of their arguments to be correct.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=76804&r1=76803&r2=76804&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jul 22 17:05:02 2009
@@ -1854,7 +1854,7 @@
       = MatchTemplateParametersToScopeSpecifier(
                                   D.getDeclSpec().getSourceRange().getBegin(),
                                                 D.getCXXScopeSpec(),
-                        (TemplateParameterList**)TemplateParamLists.release(),
+                        (TemplateParameterList**)TemplateParamLists.get(),
                                                  TemplateParamLists.size())) {
     if (TemplateParams->size() > 0) {
       // There is no such thing as a variable template.
@@ -2229,7 +2229,7 @@
         = MatchTemplateParametersToScopeSpecifier(
                                   D.getDeclSpec().getSourceRange().getBegin(),
                                   D.getCXXScopeSpec(),
-                        (TemplateParameterList**)TemplateParamLists.release(),
+                           (TemplateParameterList**)TemplateParamLists.get(),
                                                   TemplateParamLists.size())) {
     if (TemplateParams->size() > 0) {
       // This is a function template
@@ -2241,6 +2241,9 @@
     } else {
       // FIXME: Handle function template specializations
     }
+          
+    // FIXME: Free this memory properly.
+    TemplateParamLists.release();
   }        
   
   // C++ [dcl.fct.spec]p5:


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to