+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47388
+ * semantics.c (begin_for_stmt): If -fno-for-scope, don't
+ assume init must be NULL if scope is NULL.
+ (begin_range_for_stmt): Likewise.
+
2011-01-21 Jason Merrill <jason@redhat.com>
PR c++/46552
and during the instantiation of template functions.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Written by Mark Mitchell (mmitchell@usa.net) based on code found
formerly in parse.y and pt.c.
if (scope == NULL_TREE)
{
- gcc_assert (!init);
- scope = begin_for_scope (&init);
+ gcc_assert (!init || !(flag_new_for_scope > 0));
+ if (!init)
+ scope = begin_for_scope (&init);
}
FOR_INIT_STMT (r) = init;
TREE_CHAIN (r) = scope;
if (scope == NULL_TREE)
{
- gcc_assert (!init);
- scope = begin_for_scope (&init);
+ gcc_assert (!init || !(flag_new_for_scope > 0));
+ if (!init)
+ scope = begin_for_scope (&init);
}
/* RANGE_FOR_STMTs do not use nor save the init tree, so we
2011-01-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/47388
+ * g++.dg/cpp0x/range-for10.C: New test.
+ * g++.dg/template/for1.C: New test.
+
PR middle-end/45566
* g++.dg/tree-prof/partition3.C: New test.