]> granicus.if.org Git - clang/commitdiff
Tiny fix to the parsing of linkage-specifications
authorDouglas Gregor <dgregor@apple.com>
Fri, 21 Nov 2008 16:10:08 +0000 (16:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 21 Nov 2008 16:10:08 +0000 (16:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59820 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
lib/Parse/Parser.cpp

index 560edc131b05c2db36d56e7dede5a8c273eb18ac..17f5763c1d60b71b7cbbc085865a403d6bf43285 100644 (file)
@@ -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<char, 8> 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)) {
index 861609ce7538348f667ab9d80be76b41e4e7557d..86c29760d478ca93ef12ce9b231c37c9bdbab3fc 100644 (file)
@@ -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 ';'
 ///