aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Wswitch-1.c
blob: de9ee03b0a3465931d33e4f2b7c9520cfcc1d49b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* PR c++/105497 */
/* { dg-options "-Wswitch" } */

enum E {
  A,
  B,
  C __attribute((unused)),
  D
};

void
g (enum E e)
{
  switch (e)
    {
    case A:
    case B:
    case D:
      break;
    }

  switch (e) // { dg-warning "not handled in switch" }
    {
    case A:
    case B:
    case C:
      break;
    }
}