This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early
- From: "ville at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Oct 2015 19:22:39 +0000
- Subject: [Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early
- Auto-submitted: auto-generated
- References: <bug-54430-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430
--- Comment #8 from ville at gcc dot gnu.org ---
Author: ville
Date: Thu Oct 1 19:22:08 2015
New Revision: 228354
URL: https://gcc.gnu.org/viewcvs?rev=228354&root=gcc&view=rev
Log:
PR c++/54430
/cp
2015-10-01 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/54430
* name-lookup.c (push_binding): Make non-static.
* name-lookup.h (push_binding): Declare it.
* parser.c (cp_parser_range_for): Use it, get the range
declaration away from the scope until the range expression
has been parsed, then restore the declaration.
/testsuite
2015-10-01 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/54430
* g++.dg/cpp0x/range-for30.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/range-for30.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/name-lookup.h
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog