]> granicus.if.org Git - clang/commitdiff
Fix a fixme, by only parsing extern "C" in C++ mode.
authorChris Lattner <sabre@nondot.org>
Sat, 12 Jan 2008 07:08:43 +0000 (07:08 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 12 Jan 2008 07:08:43 +0000 (07:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45905 91177308-0d34-0410-b5e6-96231b3b80d8

Parse/Parser.cpp

index eeced570bb449abae4d99fe9e49b56779ebaa263..6f2a71257a059d50bd2eeb65a3b51b5f33413bdc 100644 (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);