Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order of evaluation of their arguments to be correct.

llvm-svn: 76804
This commit is contained in:
Douglas Gregor 2009-07-22 22:05:02 +00:00
parent e270d4a4dd
commit 1a7ba62e3a
1 changed files with 5 additions and 2 deletions

View 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: