[mlir] Fix typo in test vector transform pass descriptions (#118194)
[llvm-project.git] / clang / test / SemaCXX / enum-attr.cpp
blob7726aff4830a386fc115c14e2a6606877081267e
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wassign-enum -Wswitch-enum -Wcovered-switch-default -std=c++11 %s
3 enum Enum {
4 A0 = 1, A1 = 10
5 };
7 enum __attribute__((enum_extensibility(closed))) EnumClosed {
8 B0 = 1, B1 = 10
9 };
11 enum [[clang::enum_extensibility(open)]] EnumOpen {
12 C0 = 1, C1 = 10
15 enum __attribute__((flag_enum)) EnumFlag {
16 D0 = 1, D1 = 8
19 enum __attribute__((flag_enum,enum_extensibility(closed))) EnumFlagClosed {
20 E0 = 1, E1 = 8
23 enum __attribute__((flag_enum,enum_extensibility(open))) EnumFlagOpen {
24 F0 = 1, F1 = 8
27 void test() {
28 enum Enum t0;
30 switch (t0) { // expected-warning{{enumeration value 'A1' not handled in switch}}
31 case A0: break;
32 case 16: break; // expected-warning{{case value not in enumerated type}}
35 switch (t0) {
36 case A0: break;
37 case A1: break;
38 default: break; // expected-warning{{default label in switch which covers all enumeration}}
41 enum EnumClosed t1;
43 switch (t1) { // expected-warning{{enumeration value 'B1' not handled in switch}}
44 case B0: break;
45 case 16: break; // expected-warning{{case value not in enumerated type}}
48 switch (t1) {
49 case B0: break;
50 case B1: break;
51 default: break; // expected-warning{{default label in switch which covers all enumeration}}
54 enum EnumOpen t2;
56 switch (t2) { // expected-warning{{enumeration value 'C1' not handled in switch}}
57 case C0: break;
58 case 16: break;
61 switch (t2) {
62 case C0: break;
63 case C1: break;
64 default: break;
67 enum EnumFlag t3;
69 switch (t3) { // expected-warning{{enumeration value 'D1' not handled in switch}}
70 case D0: break;
71 case 9: break;
72 case 16: break; // expected-warning{{case value not in enumerated type}}
75 switch (t3) {
76 case D0: break;
77 case D1: break;
78 default: break;
81 enum EnumFlagClosed t4;
83 switch (t4) { // expected-warning{{enumeration value 'E1' not handled in switch}}
84 case E0: break;
85 case 9: break;
86 case 16: break; // expected-warning{{case value not in enumerated type}}
89 switch (t4) {
90 case E0: break;
91 case E1: break;
92 default: break;
95 enum EnumFlagOpen t5;
97 switch (t5) { // expected-warning{{enumeration value 'F1' not handled in switch}}
98 case F0: break;
99 case 9: break;
100 case 16: break;
103 switch (t5) {
104 case F0: break;
105 case F1: break;
106 default: break;