This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3780: -Wswitch not working



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]