This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] fix Objective-C, further improve error recovery for unknown type names
>> Bootstrapped (together with the semicolon patch), regtest in progress and
>> fixes all remaining failures (except the one caused by PR45062, ok for
>> mainline assuming it passes?
> OK in the absence of any objections from ObjC maintainers within 24 hours.
I'm not an ObjC maintainer, but I wrote the ObjC fast enumeration parsing code
that is being patched and I had a look at the patch - it looks Ok to me. :-)
I have one suggestion though --
> @@ -4653,14 +4658,15 @@ c_parser_for_statement (c_parser *parser
> + parser->objc_could_be_foreach_context = c_dialect_objc ();
I would change that to always set objc_could_be_foreach_context to 'true'; in C,
it has not effect, so it does no matter what you set it to. But if you always set it to
'true', then the nice assert that you added a few lines later to check that
objc_could_be_foreach_context is always set back to 'false' --
> + gcc_assert(!parser->objc_could_be_foreach_context);
gets always exercised when you run the C testsuite, which means that we are confident
that objc_could_be_foreach_context is always restored to 'false' after parsing a C "for"
loop (which is also a valid ObjC "for" loop). :-)