Re: [C++ Patch] PR 58503

2013-10-04 Thread Jason Merrill
OK. Jason

Re: [C++ Patch] PR 58503

2013-10-03 Thread Paolo Carlini
Hi, On 10/04/2013 03:41 AM, Jason Merrill wrote: Well, the permerror is saying that with -fpermissive we'll do the lookup again at instantiation time, so a testcase that declares begin/end between the template and the instantiation ought to work? Ah, now I see! The best approximation we have of

Re: [C++ Patch] PR 58503

2013-10-03 Thread Jason Merrill
On 10/03/2013 07:42 PM, Paolo Carlini wrote: My point is that do_range_for_auto_deduction is called only by cp_parser_range_for and *only* when type_dependent_expression_p is *false* for the range_expr. Aha. Now, is it possible that in a range-based for-statement with such a range_expr, begin

Re: [C++ Patch] PR 58503

2013-10-03 Thread Paolo Carlini
On 10/03/2013 03:27 PM, Jason Merrill wrote: On 10/03/2013 05:52 AM, Paolo Carlini wrote: + else if (!TREE_TYPE (*begin) || !TREE_TYPE (*end)) This should use type_dependent_expression_p. And there should be a positive test for a dependent range that exercises this code. I see what yo

Re: [C++ Patch] PR 58503

2013-10-03 Thread Jason Merrill
On 10/03/2013 05:52 AM, Paolo Carlini wrote: + else if (!TREE_TYPE (*begin) || !TREE_TYPE (*end)) This should use type_dependent_expression_p. And there should be a positive test for a dependent range that exercises this code. Jason

[C++ Patch] PR 58503

2013-10-03 Thread Paolo Carlini
Hi, in this error recovery issue in template context, do_range_for_auto_deduction calls cp_parser_perform_range_for_lookup, which can't resolve begin/end and eventually crashes because TREE_TYPE (*begin) and TREE_TYPE (*end) are NULL_TREE. It doesn't seem correct to simply early return error