http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55772



Jakub Jelinek <jakub at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|UNCONFIRMED                 |RESOLVED

                 CC|                            |jakub at gcc dot gnu.org

         Resolution|                            |INVALID



--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-21 
08:05:56 UTC ---

The error is not spurious and is correct, it doesn't matter if you use it

afterwards or not.

ISO C++98 in [stmt.dcl]/3 says:

"It is possible to transfer into a block, but not in a way that bypasses

declarations with initialization. A program that jumps 77) from a point where a

local variable with automatic storage duration is not in scope to a

point where it is in scope is ill-formed unless the variable has POD type (3.9)

and is declared without an initializer (8.5)."

And your testcase violates this, thus is ill-formed and the compiler diagnoses

it.

Reply via email to