public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28031]  New: [4.2 regression] bogus jump to case label crosses initialization error
@ 2006-06-14 16:49 tbm at cyrius dot com
  2006-06-14 16:52 ` [Bug c++/28031] [4.2 regression] bogus jump to case label crosses initialization error with C99 anonymous initializers pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tbm at cyrius dot com @ 2006-06-14 16:49 UTC (permalink / raw)
  To: gcc-bugs

I'm pretty sure the following error is bogus.  I don't see anything invalid in
this test case and it worked with g++ 4.1.  It also works with gcc 4.2 20060419
but not with the current version.

(sid)1053:tbm@reyes: ~] /usr/lib/gcc-snapshot/bin/g++ -c test.c
test.c: In function 'int main()':
test.c:16: error: jump to case label
test.c:13: error:   crosses initialization of 'terror <anonymous>'
zsh: exit 1     /usr/lib/gcc-snapshot/bin/g++ -c test.c
(sid)1054:tbm@reyes: ~] cat test.c
typedef struct terror_struct
{
    int  code;
    char msg[64];
} terror;

int main(void) {
  terror e;
  e = (terror){0,""};

  switch(1) {
  case 1:
    e = (terror){400,"Bad username"};
    break;

  case 2:
    e = (terror){503,"Turboing, connect later"};
    break;

  }
}


-- 
           Summary: [4.2 regression] bogus jump to case label crosses
                    initialization error
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

end of thread, other threads:[~2008-10-02 14:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-14 16:49 [Bug c++/28031] New: [4.2 regression] bogus jump to case label crosses initialization error tbm at cyrius dot com
2006-06-14 16:52 ` [Bug c++/28031] [4.2 regression] bogus jump to case label crosses initialization error with C99 anonymous initializers pinskia at gcc dot gnu dot org
2006-06-14 16:54 ` pinskia at gcc dot gnu dot org
2006-06-14 16:56 ` pinskia at gcc dot gnu dot org
2006-07-17  2:41 ` mmitchel at gcc dot gnu dot org
2006-07-21  1:42 ` mmitchel at gcc dot gnu dot org
2008-10-02 13:57 ` cvoica at gmail dot com
2008-10-02 14:32 ` 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).