diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2011-01-08 19:44:30 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2011-01-08 19:44:30 +0000 |
commit | 046608a3e0569946f4a499c59e02f45b057d7251 (patch) | |
tree | 7f721598e3310166b94d26cc0b888759037b4960 /gcc/c-parser.c | |
parent | f1f39033accfe89082fc2701d02bd65b57df0978 (diff) | |
download | gcc-046608a3e0569946f4a499c59e02f45b057d7251.zip gcc-046608a3e0569946f4a499c59e02f45b057d7251.tar.gz gcc-046608a3e0569946f4a499c59e02f45b057d7251.tar.bz2 |
In gcc/: 2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com>
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.
From-SVN: r168601
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 1e868af..cf34e04 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); } |