summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-08 19:44:30 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-08 19:44:30 +0000
commit14a3bc6382267ea7248e3534ce5727abb4f98228 (patch)
tree7f721598e3310166b94d26cc0b888759037b4960 /gcc/c-parser.c
parent8b0a2e8540879c8a6aec07b5d522782657301dde (diff)
downloadgcc-14a3bc6382267ea7248e3534ce5727abb4f98228.tar.gz
In gcc/:
2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com> PR objc/47078 * c-parser.c (c_parser_objc_type_name): If the type is unknown, for error recovery purposes behave as if it was not specified so that the default type is usd. In gcc/testsuite/: 2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com> PR objc/47078 * objc.dg/invalid-method-2.m: New. * obj-c++.dg/invalid-method-2.mm: New. In gcc/cp/: 2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com> PR objc/47078 * parser.c (cp_parser_objc_typename): If the type is unknown, for error recovery purposes behave as if it was not specified so that the default type is used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168601 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 1e868afddf6..cf34e041463 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -7482,6 +7482,14 @@ c_parser_objc_type_name (c_parser *parser)
type_name = c_parser_type_name (parser);
if (type_name)
type = groktypename (type_name, NULL, NULL);
+
+ /* If the type is unknown, and error has already been produced and
+ we need to recover from the error. In that case, use NULL_TREE
+ for the type, as if no type had been specified; this will use the
+ default type ('id') which is good for error recovery. */
+ if (type == error_mark_node)
+ type = NULL_TREE;
+
return build_tree_list (quals, type);
}