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 you mean. But I'm not sure that positive test can really
exist (that is, a positive test exercising the new code).
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. Now, is it possible that in a range-based
for-statement with such a range_expr, begin_expr and end_expr are
nevertheless type-dependent?
At the moment I can't see how, given the various options in C++11, also
summarized in the comment before cp_convert_range_for. Thus it seems to
me that we are dealing with very specific forms of type-dependency that
can occur only in invalid code. What do you think?
Thanks!
Paolo.