diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-04 06:33:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-04 06:33:52 +0000 |
commit | 45f965581935791a018df829a14dff53c1dd8f47 (patch) | |
tree | 49fb91aadae8ae184b90210edd16e929da76990b /lib/Parse/ParseTemplate.cpp | |
parent | b117a60f7684261ddc8c8f14e8ef8a827e6af814 (diff) |
Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 34cabfd7ad..40de81a883 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -25,7 +25,8 @@ Parser::ParseDeclarationStartingWithTemplate(unsigned Context, SourceLocation &DeclEnd, AccessSpecifier AS) { if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) - return ParseExplicitInstantiation(ConsumeToken(), DeclEnd); + return ParseExplicitInstantiation(SourceLocation(), ConsumeToken(), + DeclEnd); return ParseTemplateDeclarationOrSpecialization(Context, DeclEnd, AS); } @@ -186,7 +187,6 @@ Parser::ParseSingleDeclarationAfterTemplate( // Parse the declaration specifiers. DeclSpec DS; - // FIXME: Pass TemplateLoc through for explicit template instantiations ParseDeclarationSpecifiers(DS, TemplateInfo, AS); if (Tok.is(tok::semi)) { @@ -871,11 +871,15 @@ Parser::ParseTemplateArgumentList(TemplateArgList &TemplateArgs, /// (C++ [temp.explicit]). /// /// explicit-instantiation: -/// 'template' declaration +/// 'extern' [opt] 'template' declaration +/// +/// Note that the 'extern' is a GNU extension and C++0x feature. Parser::DeclPtrTy -Parser::ParseExplicitInstantiation(SourceLocation TemplateLoc, +Parser::ParseExplicitInstantiation(SourceLocation ExternLoc, + SourceLocation TemplateLoc, SourceLocation &DeclEnd) { return ParseSingleDeclarationAfterTemplate(Declarator::FileContext, - ParsedTemplateInfo(TemplateLoc), + ParsedTemplateInfo(ExternLoc, + TemplateLoc), DeclEnd, AS_none); } |