[Bug c/61405] Not emitting "enumeration value not handled in switch" warning for bit-field enums

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 18 09:11:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61405

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
/* PR c/61405 */
/* { dg-do compile } */
/* { dg-options "-Wswitch" } */

enum E { A, B, C };
struct S { enum E e:2; };

int
foo (struct S *s) 
{
  switch (s->e) /* { dg-warning "enumeration value .C. not handled in switch" }
*/
    {   
    case A:
      return 1;
    case B:
      return 2;
    }   
}



More information about the Gcc-bugs mailing list