diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-12-02 00:25:42 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-12-02 00:25:42 +0000 |
commit | d0f7899abb4d765cfe9da433cb17b38a425d55e8 (patch) | |
tree | 075ceadb8e8d3c2b02d0aa82b3fef533ec9e1aa7 /gcc/cp | |
parent | 2eb2e95f8f85ed62358f5d11094bbed2dbf08f64 (diff) | |
download | gcc-d0f7899abb4d765cfe9da433cb17b38a425d55e8.zip gcc-d0f7899abb4d765cfe9da433cb17b38a425d55e8.tar.gz gcc-d0f7899abb4d765cfe9da433cb17b38a425d55e8.tar.bz2 |
In gcc/objc/: 2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_build_throw_stmt): Return error_mark_node and
not NULL_TREE when a @throw is used outside of a @catch block.
In gcc/cp/:
2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_throw_statement): Use
cp_parser_expression, not cp_parser_assignment_expression, to
parse the argument of a @throw.
In gcc/testsuite/:
2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/exceptions-6.m: New.
* obj-c++.dg/exceptions-6.mm: New.
From-SVN: r167364
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bfc522a..c167e94 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com> + + * parser.c (cp_parser_objc_throw_statement): Use + cp_parser_expression, not cp_parser_assignment_expression, to + parse the argument of a @throw. + 2010-12-01 Joseph Myers <joseph@codesourcery.com> * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 826de0c..729b33f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -22705,7 +22705,8 @@ cp_parser_objc_try_catch_finally_statement (cp_parser *parser) Returns NULL_TREE. */ static tree -cp_parser_objc_synchronized_statement (cp_parser *parser) { +cp_parser_objc_synchronized_statement (cp_parser *parser) +{ location_t location; tree lock, stmt; @@ -22732,14 +22733,15 @@ cp_parser_objc_synchronized_statement (cp_parser *parser) { Returns a constructed '@throw' statement. */ static tree -cp_parser_objc_throw_statement (cp_parser *parser) { +cp_parser_objc_throw_statement (cp_parser *parser) +{ tree expr = NULL_TREE; location_t loc = cp_lexer_peek_token (parser->lexer)->location; cp_parser_require_keyword (parser, RID_AT_THROW, RT_AT_THROW); if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) - expr = cp_parser_assignment_expression (parser, false, NULL); + expr = cp_parser_expression (parser, /*cast_p=*/false, NULL); cp_parser_consume_semicolon_at_end_of_statement (parser); @@ -22749,7 +22751,8 @@ cp_parser_objc_throw_statement (cp_parser *parser) { /* Parse an Objective-C statement. */ static tree -cp_parser_objc_statement (cp_parser * parser) { +cp_parser_objc_statement (cp_parser * parser) +{ /* Try to figure out what kind of declaration is present. */ cp_token *kwd = cp_lexer_peek_token (parser->lexer); |