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 | 43e75176eccfa0432a52a96f57eb462c6d35e1df (patch) | |
tree | 7e9ad5e59c56a97dc2ff4ec7b815cd7f57fd5c33 /clang/lib/Parse/Parser.cpp | |
parent | 119b0c7185e12a183d9ad4610d602fa95a98f10d (diff) | |
download | bcm5719-llvm-43e75176eccfa0432a52a96f57eb462c6d35e1df.tar.gz bcm5719-llvm-43e75176eccfa0432a52a96f57eb462c6d35e1df.zip |
Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.
llvm-svn: 80989
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 36d5db599d4..8572d326866 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -391,6 +391,7 @@ void Parser::ParseTranslationUnit() { /// [C++0x] empty-declaration: /// ';' /// +/// [C++0x/GNU] 'extern' 'template' declaration Parser::DeclGroupPtrTy Parser::ParseExternalDeclaration() { DeclPtrTy SingleDecl; switch (Tok.getKind()) { @@ -452,6 +453,20 @@ Parser::DeclGroupPtrTy Parser::ParseExternalDeclaration() { SourceLocation DeclEnd; return ParseDeclaration(Declarator::FileContext, DeclEnd); } + case tok::kw_extern: + if (getLang().CPlusPlus && NextToken().is(tok::kw_template)) { + // Extern templates + SourceLocation ExternLoc = ConsumeToken(); + SourceLocation TemplateLoc = ConsumeToken(); + SourceLocation DeclEnd; + return Actions.ConvertDeclToDeclGroup( + ParseExplicitInstantiation(ExternLoc, TemplateLoc, DeclEnd)); + } + + // FIXME: Detect C++ linkage specifications here? + + // Fall through to handle other declarations or function definitions. + default: // We can't tell whether this is a function-definition or declaration yet. return ParseDeclarationOrFunctionDefinition(); |