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]

Re: [PATCH] Fix PR c++/60393


On 2014-03-07 17:29, Jason Merrill wrote:
On 03/04/2014 04:46 PM, Adam Butcher wrote:
	PR c++/60393
	* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a move general location, ...
	(cp_parser_error): ... here.

Hmm, I'm uncomfortable with this change; not all errors lead to
unwinding the whole declaration context.  Typically they just mean
we're changing from one tentative parse to another.  If for instance
you had a function with one generic parameter and one with a type like
A<42>, we would try to parse 42 as a type and hit cp_parser_error
before parsing it as an expression.

Ah right. I did wonder about tentative parsing. What about in cp_parser_skip_to_end_of_statement?

Alternative seems to be that we explicitly handle each case.


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