Commit a558c1e2 by Jason Merrill Committed by Jason Merrill

parser.c (cp_parser_range_for): Don't try to deduce from {} in a template.

	* parser.c (cp_parser_range_for): Don't try to deduce from {}
	in a template.

From-SVN: r179443
parent bb69f33b
2011-10-02 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_range_for): Don't try to deduce from {}
in a template.
PR c++/35722
Implement N2555 (expanding pack expansion to fixed parm list)
* pt.c (coerce_template_parms): Allow expanding a pack expansion
......
......@@ -8688,7 +8688,9 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl)
{
stmt = begin_range_for_stmt (scope, init);
finish_range_for_decl (stmt, range_decl, range_expr);
if (!type_dependent_expression_p (range_expr))
if (!type_dependent_expression_p (range_expr)
/* do_auto_deduction doesn't mess with template init-lists. */
&& !BRACE_ENCLOSED_INITIALIZER_P (range_expr))
do_range_for_auto_deduction (range_decl, range_expr);
}
else
......
2011-10-02 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/range-for22.C: New.
* g++.dg/cpp0x/variadic65.C: Remove xfails.
* g++.dg/cpp0x/variadic82.C: Remove xfails.
* g++.dg/cpp0x/variadic83.C: Remove xfails.
......
// { dg-options -std=c++0x }
template<int I> void f() {
for (auto i: {I} );
}
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