This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix objc/23709, error recovery for method's prototype


The problem here is that we go into we find a semicolon which might be much later
in parsing after after the @interface has been closed by @end. So we could get
much worse and confusing error messsages if this happens. This fixes the problem
by changing to require a semicolon and then skip to the possible beginning of
a prototype or the end of the @interface.


OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Note this is a regression with the new C parser.

Thanks,
Andrew Pinski

ChangeLog:

	* c-parser.c (c_parser_skip_to_end_methodproto): New function.
	(c_parser_objc_methodproto): Instead of skipping till a ";",
	require a ";" and if that returns true, call
	c_parser_skip_to_end_methodproto.

testsuite/ChangeLog:

* objc.dg/error-2.m: New test.


Attachment: t.diff.txt
Description: Text document


Attachment: error-2.m
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]