diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bfc522a6f580b7774814bfceac9593df2e243f85..c167e9434569188acdfd2c59b8d31df46c21cc1e 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 826de0c4106e8811bd479e082c0d3b9b564f56d7..729b33f2f98ad11667009f57168b3efc2dccff9c 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);
 
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 90765eb93e53f814497340f48b17b5ec50dd940d..70ca6a8807e64b906979410e1030e8fa85a4035c 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
 2010-11-30  Nicola Pero  <nicola.pero@meta-innovation.com>
 
 	* objc-act.c (objc_build_volatilized_type): Removed.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index b9cb6508ec6a5afed12ba1a68687b098979fb7ad..7eba65e31059a2f6ea52418313126733887e9400 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -5520,7 +5520,7 @@ objc_build_throw_stmt (location_t loc, tree throw_expr)
           || cur_try_context->current_catch == NULL)
 	{
 	  error_at (loc, "%<@throw%> (rethrow) used outside of a @catch block");
-	  return NULL_TREE;
+	  return error_mark_node;
 	}
 
       /* Otherwise the object is still sitting in the EXC_PTR_EXPR
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 332c0bc1a22512fd104765ba4087f1f1ad264c9c..51b34fcbbe50245ef4cc0073769b8f7c691b5220 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-02  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+	* objc.dg/exceptions-6.m: New.
+	* obj-c++.dg/exceptions-6.mm: New.	
+	
 2010-12-01  Jan Hubicka  <jh@suse.cz>
 
 	* gcc.c-torture/execute/bcp-1.c: Make ready for -fuse-linker-plugin
diff --git a/gcc/testsuite/obj-c++.dg/exceptions-6.mm b/gcc/testsuite/obj-c++.dg/exceptions-6.mm
new file mode 100644
index 0000000000000000000000000000000000000000..58882fed8b71acf4000ff4137112d82547ea5074
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/exceptions-6.mm
@@ -0,0 +1,29 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
+/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do compile } */
+
+/* Test warnings when parsing syntax errors in @throw.  */
+
+#include <objc/objc.h>
+
+void test (id object)
+{
+  @throw object;   /* Ok */
+  @throw;          /* { dg-error ".@throw. .rethrow. used outside of a @catch block" } */
+  @throw (object); /* Ok.  */
+  @throw (id)0
+}                  /* { dg-error "expected" } */
+
+void test2 (id object)
+{
+  @throw object);  /* { dg-error "expected" } */
+  @throw (...);    /* { dg-error "expected" } */
+  @throw ();       /* { dg-error "expected" } */
+  @throw           
+}                  /* { dg-error "expected" } */
+
+void test3 (id object1, id object2)
+{
+  /* This is apparently valid.  */
+  @throw object1, object2; /* Ok.  */
+}
diff --git a/gcc/testsuite/objc.dg/exceptions-6.m b/gcc/testsuite/objc.dg/exceptions-6.m
new file mode 100644
index 0000000000000000000000000000000000000000..58882fed8b71acf4000ff4137112d82547ea5074
--- /dev/null
+++ b/gcc/testsuite/objc.dg/exceptions-6.m
@@ -0,0 +1,29 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
+/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do compile } */
+
+/* Test warnings when parsing syntax errors in @throw.  */
+
+#include <objc/objc.h>
+
+void test (id object)
+{
+  @throw object;   /* Ok */
+  @throw;          /* { dg-error ".@throw. .rethrow. used outside of a @catch block" } */
+  @throw (object); /* Ok.  */
+  @throw (id)0
+}                  /* { dg-error "expected" } */
+
+void test2 (id object)
+{
+  @throw object);  /* { dg-error "expected" } */
+  @throw (...);    /* { dg-error "expected" } */
+  @throw ();       /* { dg-error "expected" } */
+  @throw           
+}                  /* { dg-error "expected" } */
+
+void test3 (id object1, id object2)
+{
+  /* This is apparently valid.  */
+  @throw object1, object2; /* Ok.  */
+}