Fix a fixme, by only parsing extern "C" in C++ mode.

llvm-svn: 45905
This commit is contained in:
Chris Lattner 2008-01-12 07:08:43 +00:00
parent 38376f1595
commit 65531e8fb7
1 changed files with 1 additions and 2 deletions

View File

@ -389,8 +389,7 @@ Parser::DeclTy *Parser::ParseDeclarationOrFunctionDefinition() {
// If the declspec consisted only of 'extern' and we have a string
// literal following it, this must be a C++ linkage specifier like
// 'extern "C"'.
// FIXME: This should be limited to just C++/ObjectiveC++
if (Tok.is(tok::string_literal) &&
if (Tok.is(tok::string_literal) && getLang().CPlusPlus &&
DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier)
return ParseLinkage(Declarator::FileContext);