Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope
llvm-svn: 60830
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index c1120d5..d21dc4a 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -41,7 +41,7 @@
SourceLocation TemplateLoc = ConsumeToken();
// Enter template-parameter scope.
- EnterScope(Scope::TemplateParamScope);
+ ParseScope TemplateParmScope(this, Scope::TemplateParamScope);
// Try to parse the template parameters, and the declaration if
// successful.
@@ -49,9 +49,6 @@
if(ParseTemplateParameters(0))
TemplateDecl = ParseDeclarationOrFunctionDefinition();
- // Leave template-parameter scope.
- ExitScope();
-
return TemplateDecl;
}