Commit c1703fc1 by Paolo Carlini Committed by Paolo Carlini

re PR c++/49838 ([C++0x] ICE in cp_parser_perform_range_for_lookup, at cp/parser.c:8796)

/cp
2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/49838
	* parser.c (cp_parser_perform_range_for_lookup): Early return if
	error_operand_p (range).

/testsuite
2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/49838
	* g++.dg/cpp0x/range-for19.C: New.

From-SVN: r176754
parent c2d8a62e
2011-07-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/49838
* parser.c (cp_parser_perform_range_for_lookup): Early return if
error_operand_p (range).
2011-07-23 Jason Merrill <jason@redhat.com>
PR c++/49823
......
......@@ -8795,6 +8795,9 @@ cp_convert_range_for (tree statement, tree range_decl, tree range_expr)
static tree
cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
{
if (error_operand_p (range))
return error_mark_node;
if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (range))))
{
error ("range-based %<for%> expression of type %qT "
......
2011-07-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/49838
* g++.dg/cpp0x/range-for19.C: New.
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR testsuite/49753
......
// PR c++/49838
// { dg-do compile }
// { dg-options "-std=c++0x" }
int main()
{
auto a; // { dg-error "no initializer" }
for(auto i: a) // { dg-error "deduce" }
;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment