summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-22 22:05:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-22 22:05:02 +0000
commit1a7ba62e3a99b7b0adcc41c7cceeb777e4e1e355 (patch)
tree461fd62bf7ef500c80b87d90317504f8639b12b9 /clang/lib/Sema/SemaDecl.cpp
parente270d4a4ddfabe1620f12df30ca930c35e127152 (diff)
downloadbcm5719-llvm-1a7ba62e3a99b7b0adcc41c7cceeb777e4e1e355.tar.gz
bcm5719-llvm-1a7ba62e3a99b7b0adcc41c7cceeb777e4e1e355.zip
Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order of evaluation of their arguments to be correct.
llvm-svn: 76804
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 2db07256110..2e280f58cb5 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -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:
OpenPOWER on IntegriCloud