From bae35118fc5cea2da08567dbb9763af7f906dae2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Aug 2007 18:15:16 +0000 Subject: [PATCH] read and ignore the body of a namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41403 91177308-0d34-0410-b5e6-96231b3b80d8 --- Parse/ParseDeclCXX.cpp | 5 ++++- Parse/Parser.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Parse/ParseDeclCXX.cpp b/Parse/ParseDeclCXX.cpp index 50f0c2a28d..73ae790153 100644 --- a/Parse/ParseDeclCXX.cpp +++ b/Parse/ParseDeclCXX.cpp @@ -64,7 +64,10 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) { SourceLocation LBrace = ConsumeBrace(); // FIXME: push a scope, push a namespace decl. - // FIXME: Parse namespace-body + while (Tok.getKind() != tok::r_brace && Tok.getKind() != tok::eof) { + // FIXME capture the decls. + ParseExternalDeclaration(); + } SourceLocation RBrace = MatchRHSPunctuation(tok::r_brace, LBrace); diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp index 0991675481..d9d79613d2 100644 --- a/Parse/Parser.cpp +++ b/Parse/Parser.cpp @@ -340,7 +340,7 @@ Parser::DeclTy *Parser::ParseExternalDeclaration() { return 0; case tok::kw_namespace: case tok::kw_typedef: - // A function definition cannot start with a 'typedef' keyword. + // A function definition cannot start with a these keywords. return ParseDeclaration(Declarator::FileContext); default: // We can't tell whether this is a function-definition or declaration yet.