public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tbm at cyrius dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/28031]  New: [4.2 regression] bogus jump to case label crosses initialization error
Date: Wed, 14 Jun 2006 16:49:00 -0000	[thread overview]
Message-ID: <bug-28031-12387@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2006-06-14 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14 16:49 tbm at cyrius dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28031-12387@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).