aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r--lib/Parse/ParseTemplate.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index d0e63496b5..b70a51da9e 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -27,20 +27,13 @@ Decl *
Parser::ParseDeclarationStartingWithTemplate(unsigned Context,
SourceLocation &DeclEnd,
AccessSpecifier AS) {
- Decl *DC = getObjCDeclContext();
- if (DC)
- Actions.ActOnObjCContainerFinishDefinition(DC);
+ ObjCDeclContextSwitch ObjCDC(*this);
+
if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) {
- Decl *Res = ParseExplicitInstantiation(SourceLocation(), ConsumeToken(),
+ return ParseExplicitInstantiation(SourceLocation(), ConsumeToken(),
DeclEnd);
- if (DC)
- Actions.ActOnObjCContainerStartDefinition(DC);
- return Res;
}
- Decl *Res = ParseTemplateDeclarationOrSpecialization(Context, DeclEnd, AS);
- if (DC)
- Actions.ActOnObjCContainerStartDefinition(DC);
- return Res;
+ return ParseTemplateDeclarationOrSpecialization(Context, DeclEnd, AS);
}
/// \brief RAII class that manages the template parameter depth.