]> granicus.if.org Git - clang/commitdiff
Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order...
authorDouglas Gregor <dgregor@apple.com>
Wed, 22 Jul 2009 22:05:02 +0000 (22:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 22 Jul 2009 22:05:02 +0000 (22:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76804 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 2db072561103253f702f0b1dccaa9477dad5e7e8..2e280f58cb5b49646739b4f0b4833d9a0b0af853 100644 (file)
@@ -1854,7 +1854,7 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
       = 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 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
         = 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 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
     } else {
       // FIXME: Handle function template specializations
     }
+          
+    // FIXME: Free this memory properly.
+    TemplateParamLists.release();
   }        
   
   // C++ [dcl.fct.spec]p5: