public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ajd at gentrack dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/20571] New: -Wswitch incorrectly outputs warning on ranges (regression from 3.4) Date: Sun, 20 Mar 2005 21:35:00 -0000 [thread overview] Message-ID: <20050320213502.20571.ajd@gentrack.com> (raw) Test program: enum fred { apple, orange, fruit_1, fruit_2, fruit_3, }; int xx() { fred e; switch (e) { case apple: ; case orange: ; case fruit_1 ... fruit_3: ; } } gcc 3.4 correctly accepts this code without warning. gcc 4.0 (of Mar 17 18:06 UTC) incorrectly generates a warning. $ /opt/gcc-3.4/bin/g++ -Wswitch -c a1.cpp $ /opt/gcc-4.0.pre/bin/g++ -Wswitch -c a1.cpp a1.cpp: In function 'int xx()': a1.cpp:13: warning: enumeration value 'fruit_2' not handled in switch a1.cpp:13: warning: enumeration value 'fruit_3' not handled in switch -- Summary: -Wswitch incorrectly outputs warning on ranges (regression from 3.4) Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ajd at gentrack dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20571
next reply other threads:[~2005-03-20 21:35 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-03-20 21:35 ajd at gentrack dot com [this message] 2005-03-20 23:34 ` [Bug c++/20571] " pinskia 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=20050320213502.20571.ajd@gentrack.com \ --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: linkBe 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).