public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21491] New: [4.0/4.1 Regression] crosses initialization of a pointer
@ 2005-05-10 14:59 pinskia at gcc dot gnu dot org
  2005-05-10 14:59 ` [Bug c++/21491] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-10 14:59 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-09-27 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-10 14:59 [Bug c++/21491] New: [4.0/4.1 Regression] crosses initialization of a pointer pinskia at gcc dot gnu dot org
2005-05-10 14:59 ` [Bug c++/21491] " pinskia at gcc dot gnu dot org
2005-05-10 19:33 ` pinskia at gcc dot gnu dot org
2005-05-15 14:11 ` lerdsuwa at gcc dot gnu dot org
2005-07-08  1:44 ` mmitchel at gcc dot gnu dot org
2005-09-10  3:07 ` [Bug c++/21491] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).