This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21487] new object affectation in a switch
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2005 14:51:05 -0000
- Subject: [Bug c++/21487] new object affectation in a switch
- References: <20050510123300.21487.sebmaestro@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-10 14:51 -------
(In reply to comment #2)
> Subject: RE: new object affectation in a switch
>
> So, I don't understand why :
...
> is OK for g++.
Because there is no initialization of a variable in the declaration.
....
> is "correct" too, but
because there is no case statement after the initialization of the variable so there is no way to cross the
initialization.
> is rejected with a french and english (:-D) error message !
Because you cross an initialization.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21487