diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-01-02 20:30:45 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-01-02 20:30:45 +0000 |
commit | 1092805d387f6aa958ae2c7e26831a5ad511bb80 (patch) | |
tree | b2356deaeb82456d21ef1dc7f80d31519d4984e6 | |
parent | 4971227d2501045a28d858cb1a807908c18f3a19 (diff) | |
download | gcc-1092805d387f6aa958ae2c7e26831a5ad511bb80.zip gcc-1092805d387f6aa958ae2c7e26831a5ad511bb80.tar.gz gcc-1092805d387f6aa958ae2c7e26831a5ad511bb80.tar.bz2 |
parser.c (cp_parser_declaration): Accept the __extension__ keyword before the declaration.
* parser.c (cp_parser_declaration): Accept the __extension__
keyword before the declaration.
From-SVN: r60802
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 19 |
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c23e423..b8650d5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2003-01-02 Mark Mitchell <mark@codesourcery.com> + * parser.c (cp_parser_declaration): Accept the __extension__ + keyword before the declaration. + PR c++/2843 * parser.c (cp_parser_parameter_declaration): Allow attributes to appear after the declarator. @@ -15,7 +18,7 @@ (cp_parser_parsing_tentatively): Likewise. (cp_parser_nested_name_specifier_opt): Reduce the number of calls to the cp_lexer_peek_token. - + * parser.c (cp_parser_sizeof_operand): Do not evaluate the expression. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index dca6853..ac920f0 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6533,7 +6533,12 @@ cp_parser_declaration_seq_opt (parser) explicit-instantiation explicit-specialization linkage-specification - namespace-definition */ + namespace-definition + + GNU extension: + + declaration: + __extension__ declaration */ static void cp_parser_declaration (parser) @@ -6541,6 +6546,18 @@ cp_parser_declaration (parser) { cp_token token1; cp_token token2; + int saved_pedantic; + + /* Check for the `__extension__' keyword. */ + if (cp_parser_extension_opt (parser, &saved_pedantic)) + { + /* Parse the qualified declaration. */ + cp_parser_declaration (parser); + /* Restore the PEDANTIC flag. */ + pedantic = saved_pedantic; + + return; + } /* Try to figure out what kind of declaration is present. */ token1 = *cp_lexer_peek_token (parser->lexer); |