From mboxrd@z Thu Jan 1 00:00:00 1970 From: jfasch@aon.at To: gcc-gnats@gcc.gnu.org Subject: c++/3780: -Wswitch not working Date: Mon, 23 Jul 2001 14:26:00 -0000 Message-id: <20010723212233.18685.qmail@sourceware.cygnus.com> X-SW-Source: 2001-07/msg00618.html List-Id: >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: