| 1 |
// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify -Wswitch %s |
| 2 |
|
| 3 |
typedef enum : long { E0 } E; |
| 4 |
void test1(E e) { |
| 5 |
auto v = E0; |
| 6 |
switch (v) { } // expected-warning {{enumeration value 'E0' not handled in switch}} |
| 7 |
} |
| 8 |
|
| 9 |
void test2(E e) { |
| 10 |
__auto_type v = E0; |
| 11 |
switch (v) { } // expected-warning {{enumeration value 'E0' not handled in switch}} |
| 12 |
} |
| 13 |
|
| 14 |
void test3(_Bool b, E e) { |
| 15 |
__auto_type v = E0; |
| 16 |
if (b) { |
| 17 |
v = e; |
| 18 |
} |
| 19 |
switch (v) { } // expected-warning {{enumeration value 'E0' not handled in switch}} |
| 20 |
} |