1 // RUN: %clang_cc1 -fsyntax-only -verify -Wassign-enum -Wswitch-enum -Wcovered-switch-default -std=c++11 %s
7 enum __attribute__((enum_extensibility(closed
))) EnumClosed
{
11 enum [[clang::enum_extensibility(open
)]] EnumOpen
{
15 enum __attribute__((flag_enum
)) EnumFlag
{
19 enum __attribute__((flag_enum
,enum_extensibility(closed
))) EnumFlagClosed
{
23 enum __attribute__((flag_enum
,enum_extensibility(open
))) EnumFlagOpen
{
30 switch (t0
) { // expected-warning{{enumeration value 'A1' not handled in switch}}
32 case 16: break; // expected-warning{{case value not in enumerated type}}
38 default: break; // expected-warning{{default label in switch which covers all enumeration}}
43 switch (t1
) { // expected-warning{{enumeration value 'B1' not handled in switch}}
45 case 16: break; // expected-warning{{case value not in enumerated type}}
51 default: break; // expected-warning{{default label in switch which covers all enumeration}}
56 switch (t2
) { // expected-warning{{enumeration value 'C1' not handled in switch}}
69 switch (t3
) { // expected-warning{{enumeration value 'D1' not handled in switch}}
72 case 16: break; // expected-warning{{case value not in enumerated type}}
81 enum EnumFlagClosed t4
;
83 switch (t4
) { // expected-warning{{enumeration value 'E1' not handled in switch}}
86 case 16: break; // expected-warning{{case value not in enumerated type}}
97 switch (t5
) { // expected-warning{{enumeration value 'F1' not handled in switch}}