This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/3780: -Wswitch not working
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/3780: -Wswitch not working
- From: jfasch at aon dot at
- Date: 23 Jul 2001 21:22:33 -0000
- Reply-To: jfasch at aon dot at
>Number: 3780
>Category: c++
>Synopsis: -Wswitch not working
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 23 14:26:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Joerg Faschingbauer
>Release: 3.0
>Organization:
>Environment:
Stock Redhat 7.1 (kernel 2.4.2, glibc 2.2.2), Pentium 200
>Description:
when compiling the following code with -Wswitch,
enum Enum {
A
};
void f() {
Enum e;
switch (e) {}
}
I'd expect to see a warning about as "enumeration value `A' not handled in switch".
>How-To-Repeat:
>Fix:
a quick (and dirty?) solution works for me:
disable default_conversion() in cp/typeck.c for
ENUMERAL_TYPE. this preserves the ENUMERAL_TYPE and its
possible values until
stmt.c:check_for_full_enumeration_handling()
which is called from stmt.c:expand_end_case().
>Release-Note:
>Audit-Trail:
>Unformatted: