diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 15:54:49 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 15:54:49 +0000 |
commit | a28948f34817476d02412fa204cae038e228c827 (patch) | |
tree | 3aab4757cbcd4cf2b320a93fec061b4f0497343a /lib/Parse/ParseTemplate.cpp | |
parent | ec5bc81fd55bfcc26fc4bde6d5e33113d94c2209 (diff) |
Restore patch I reversed in r138040. Known buildbot
failures are resolved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 05fabebed2..d0e63496b5 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -27,11 +27,20 @@ Decl * Parser::ParseDeclarationStartingWithTemplate(unsigned Context, SourceLocation &DeclEnd, AccessSpecifier AS) { - if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) - return ParseExplicitInstantiation(SourceLocation(), ConsumeToken(), - DeclEnd); - - return ParseTemplateDeclarationOrSpecialization(Context, DeclEnd, AS); + Decl *DC = getObjCDeclContext(); + if (DC) + Actions.ActOnObjCContainerFinishDefinition(DC); + if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { + Decl *Res = ParseExplicitInstantiation(SourceLocation(), ConsumeToken(), + DeclEnd); + if (DC) + Actions.ActOnObjCContainerStartDefinition(DC); + return Res; + } + Decl *Res = ParseTemplateDeclarationOrSpecialization(Context, DeclEnd, AS); + if (DC) + Actions.ActOnObjCContainerStartDefinition(DC); + return Res; } /// \brief RAII class that manages the template parameter depth. |