This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21491] New: [4.0/4.1 Regression] crosses initialization of a pointer
- 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:58:59 -0000
- Subject: [Bug c++/21491] New: [4.0/4.1 Regression] crosses initialization of a pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following is invalid C++ and should be rejected:
struct Thing {
Thing(){}
};
int f (int i)
{
switch (i)
{
case 1:
Thing *str = new Thing;
case 2:
case 3:
;
}
return 0;
}
Previous versions before 4.0.0 rejected with the following message:
t.cc:11: error: jump to case label
t.cc:10: error: crosses initialization of `Thing*str'
t.cc:12: error: jump to case label
t.cc:10: error: crosses initialization of `Thing*str'
--
Summary: [4.0/4.1 Regression] crosses initialization of a pointer
Product: gcc
Version: unknown
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21491