Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 #if !__has_feature(objc_fixed_enum)
      4 #  error Enumerations with a fixed underlying type are not supported
      5 #endif
      6 
      7 typedef long Integer;
      8 
      9 typedef enum : Integer { Enumerator1, Enumerator2 } Enumeration;
     10 
     11 int array[sizeof(Enumeration) == sizeof(long)? 1 : -1];
     12 
     13 
     14 enum Color { Red, Green, Blue };
     15 
     16 struct X { 
     17   enum Color : 4;
     18   enum Color field1: 4;
     19   enum Other : Integer field2;
     20   enum Other : Integer field3 : 4;
     21   enum  : Integer { Blah, Blarg } field4 : 4;
     22 };
     23 
     24 void test() {
     25   long value = 2;
     26   Enumeration e = value;
     27 }
     28