[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2016-07-20 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

--- Comment #12 from Jason Merrill  ---
Author: jason
Date: Thu Jul 21 06:15:43 2016
New Revision: 238569

URL: https://gcc.gnu.org/viewcvs?rev=238569&root=gcc&view=rev
Log:
PR c++/71604 - type definition in range-based for

PR c++/54430
* parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
(cp_parser_simple_declaration): Diagnose type definition in
for-range-declaration.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/range-for31.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/parser.c
branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/range-for8.C

[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2016-07-15 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

--- Comment #11 from Jason Merrill  ---
Author: jason
Date: Fri Jul 15 18:38:31 2016
New Revision: 238391

URL: https://gcc.gnu.org/viewcvs?rev=238391&root=gcc&view=rev
Log:
PR c++/71604 - type definition in range-based for

PR c++/54430
* parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
(cp_parser_simple_declaration): Diagnose type definition in
for-range-declaration.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/range-for31.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/g++.dg/cpp0x/range-for8.C

[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2016-02-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Jonathan Wakely  changed:

   What|Removed |Added

 CC||oszi at inf dot u-szeged.hu

--- Comment #10 from Jonathan Wakely  ---
*** Bug 69784 has been marked as a duplicate of this bug. ***

[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-10-05 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Paolo Carlini  changed:

   What|Removed |Added

   Target Milestone|--- |6.0


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-10-01 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Ville Voutilainen  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||ville.voutilainen at gmail dot 
com
 Resolution|--- |FIXED

--- Comment #9 from Ville Voutilainen  ---
Fixed on trunk.


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-10-01 Thread ville at gcc dot gnu.org
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  

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  

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


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-09-15 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Jonathan Wakely  changed:

   What|Removed |Added

 CC||tony at becrux dot com

--- Comment #7 from Jonathan Wakely  ---
*** Bug 67584 has been marked as a duplicate of this bug. ***


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-08-16 Thread miyuki at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Mikhail Maltsev  changed:

   What|Removed |Added

 CC||bloerwald at googlemail dot com

--- Comment #6 from Mikhail Maltsev  ---
*** Bug 65201 has been marked as a duplicate of this bug. ***


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-08-09 Thread akim.demaille at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

--- Comment #5 from Akim Demaille  ---
FWIW, it's on StackOverflow since May 2013.

http://stackoverflow.com/questions/16407212/identifier-with-the-same-name-in-both-expression-and-declaration-of-range-based


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2015-08-09 Thread akim.demaille at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Akim Demaille  changed:

   What|Removed |Added

 CC||akim.demaille at gmail dot com

--- Comment #4 from Akim Demaille  ---
I hit that one too with 5.2.


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2014-03-28 Thread ppluzhnikov at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Paul Pluzhnikov  changed:

   What|Removed |Added

 CC||ppluzhnikov at google dot com

--- Comment #2 from Paul Pluzhnikov  ---
*** Bug 57493 has been marked as a duplicate of this bug. ***


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2014-03-28 Thread ppluzhnikov at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

--- Comment #3 from Paul Pluzhnikov  ---
>From PR57493: Google ref: b/9229787


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2014-03-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-03-28
 Ever confirmed|0   |1


[Bug c++/54430] [C++11] For-Loop: Scope of iterating variable begins too early

2014-03-28 Thread tclamb at ufl dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Thomas Lamb  changed:

   What|Removed |Added

 CC||tclamb at ufl dot edu

--- Comment #1 from Thomas Lamb  ---
Just hit this bug in GCC 4.9. Again, the lhs side has scope before the rhs has
been evaluated, which is against the standardese in section 6.5.4 of both N3936
and N3291.