diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-12-30 20:18:38 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-12-30 20:18:38 +0000 |
commit | c838d82f7be4c89e64f33772bcadb05061e2730a (patch) | |
tree | 6b19fbbf6f8a876481fad25dffe6dd476564f275 | |
parent | afd9b9dd9d8dded871213080f545548e193acfc1 (diff) | |
download | gcc-c838d82f7be4c89e64f33772bcadb05061e2730a.zip gcc-c838d82f7be4c89e64f33772bcadb05061e2730a.tar.gz gcc-c838d82f7be4c89e64f33772bcadb05061e2730a.tar.bz2 |
* parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
From-SVN: r60644
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 050ba95..db212ba 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2002-12-30 Mark Mitchell <mark@codesourcery.com> + + * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change. + 2002-12-30 David Edelsohn <edelsohn@gnu.org> * parser.c (cp_parser_parameter_declaration_clause): Treat system diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9474250..cb8dbe9 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6456,6 +6456,20 @@ cp_parser_declaration_seq_opt (parser) continue; } + /* The C lexer modifies PENDING_LANG_CHANGE when it wants the + parser to enter or exit implict `extern "C"' blocks. */ + while (pending_lang_change > 0) + { + push_lang_context (lang_name_c); + --pending_lang_change; + } + while (pending_lang_change < 0) + { + pop_lang_context (); + ++pending_lang_change; + } + + /* Parse the declaration itself. */ cp_parser_declaration (parser); } } |