Commit 59276295 by Jason Merrill Committed by Jason Merrill

re PR c++/51046 ([C++0x] ICE by unexpanded template param pack in range-based for)

	PR c++/51046
	* parser.c (cp_parser_range_for): check_for_bare_parameter_packs.

From-SVN: r181239
parent d3e472a3
2011-11-09 Jason Merrill <jason@redhat.com>
PR c++/51046
* parser.c (cp_parser_range_for): check_for_bare_parameter_packs.
PR c++/51029
* class.c (build_base_path): Don't ICE in fold_non_dependent_expr.
......
......@@ -9292,6 +9292,8 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl)
at instantiation. If not, it is done just ahead. */
if (processing_template_decl)
{
if (check_for_bare_parameter_packs (range_expr))
range_expr = error_mark_node;
stmt = begin_range_for_stmt (scope, init);
finish_range_for_decl (stmt, range_decl, range_expr);
if (!type_dependent_expression_p (range_expr)
......
2011-11-09 Jason Merrill <jason@redhat.com>
PR c++/51046
* g++.dg/cpp0x/variadic119.C: New.
2011-11-09 Jakub Jelinek <jakub@redhat.com>
PR target/50911
......
// PR c++/51046
// { dg-do compile { target c++11 } }
template<int... IS>
void f()
{
for (int i : IS); // { dg-error "not expanded" }
}
int main()
{
f<0, 1, 2>();
}
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