(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
pr61405.c
       1  /* PR c/61405 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Wswitch" } */
       4  
       5  enum E { A, B, C };
       6  struct S { enum E e:2; };
       7  typedef struct S TS;
       8  
       9  int
      10  fn0 (struct S *s)
      11  {
      12    switch (s->e) /* { dg-warning "enumeration value .C. not handled in switch" } */
      13      {
      14      case A:
      15        return 1;
      16      case B:
      17        return 2;
      18      }
      19    return 3;
      20  }
      21  
      22  int
      23  fn1 (TS *s)
      24  {
      25    switch (s->e) /* { dg-warning "enumeration value .C. not handled in switch" } */
      26      {
      27      case A:
      28        return 1;
      29      case B:
      30        return 2;
      31      }
      32    return 3;
      33  }