PR c++/49983
* parser.c (cp_parser_range_for): Only do auto deduction in
template if the range is non-dependent.
From-SVN: r177478
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49983
+ * parser.c (cp_parser_range_for): Only do auto deduction in
+ template if the range is non-dependent.
+
* init.c (perform_member_init): Always build_aggr_init
for a class member with an explicit mem-initializer.
{
stmt = begin_range_for_stmt (scope, init);
finish_range_for_decl (stmt, range_decl, range_expr);
- do_range_for_auto_deduction (range_decl, range_expr);
+ if (!type_dependent_expression_p (range_expr))
+ do_range_for_auto_deduction (range_decl, range_expr);
}
else
{
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49983
+ * g++.dg/cpp0x/range-for21.C: New.
+
* g++.dg/ext/vla11.C: New.
2011-08-05 Richard Guenther <rguenther@suse.de>
--- /dev/null
+// PR c++/49983
+// { dg-options -std=c++0x }
+
+template <class T>
+void f(T t)
+{
+ for (auto v : t);
+}