public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20571] New: -Wswitch incorrectly outputs warning on ranges (regression from 3.4)
@ 2005-03-20 21:35 ajd at gentrack dot com
  2005-03-20 23:34 ` [Bug c++/20571] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ajd at gentrack dot com @ 2005-03-20 21:35 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug c++/20571] -Wswitch incorrectly outputs warning on ranges (regression from 3.4)
  2005-03-20 21:35 [Bug c++/20571] New: -Wswitch incorrectly outputs warning on ranges (regression from 3.4) ajd at gentrack dot com
@ 2005-03-20 23:34 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-20 23:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-20 23:34 -------


*** This bug has been marked as a duplicate of 18715 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-03-20 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-20 21:35 [Bug c++/20571] New: -Wswitch incorrectly outputs warning on ranges (regression from 3.4) ajd at gentrack dot com
2005-03-20 23:34 ` [Bug c++/20571] " pinskia 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).