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
This commit is contained in:
Jason Merrill 2011-11-09 17:25:12 -05:00 committed by Jason Merrill
parent d3e472a32e
commit 59276295d6
4 changed files with 23 additions and 0 deletions

View File

@ -1,5 +1,8 @@
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.

View File

@ -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)

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,13 @@
// 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>();
}