From: Douglas Gregor Date: Fri, 21 Nov 2008 16:10:08 +0000 (+0000) Subject: Tiny fix to the parsing of linkage-specifications X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c19923dda3d28f67aab4726cd40bb07032758383;p=clang Tiny fix to the parsing of linkage-specifications git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59820 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 560edc131b..17f5763c1d 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -98,7 +98,7 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) { /// 'extern' string-literal declaration /// Parser::DeclTy *Parser::ParseLinkage(unsigned Context) { - assert(Tok.is(tok::string_literal) && "Not a stringliteral!"); + assert(Tok.is(tok::string_literal) && "Not a string literal!"); llvm::SmallVector LangBuffer; // LangBuffer is guaranteed to be big enough. LangBuffer.resize(Tok.getLength()); @@ -110,7 +110,7 @@ Parser::DeclTy *Parser::ParseLinkage(unsigned Context) { SourceLocation LBrace, RBrace; if (Tok.isNot(tok::l_brace)) { - D = ParseDeclaration(Context); + D = ParseDeclarationOrFunctionDefinition(); } else { LBrace = ConsumeBrace(); while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) { diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 861609ce75..86c29760d4 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -295,7 +295,7 @@ void Parser::ParseTranslationUnit() { } /// ParseExternalDeclaration: -/// external-declaration: [C99 6.9] +/// external-declaration: [C99 6.9], declaration: [C++ dcl.dcl] /// function-definition /// declaration /// [EXT] ';' @@ -307,7 +307,7 @@ void Parser::ParseTranslationUnit() { /// [OBJC] objc-protocol-definition /// [OBJC] objc-method-definition /// [OBJC] @end -/// +/// [C++] linkage-specification /// [GNU] asm-definition: /// simple-asm-expr ';' ///