1 // { dg-options "-std=c++0x" }
9 Red, // { dg-error "previously declared here" }
16 Red // { dg-error "redeclaration" }
36 f(color); // okay: unscoped enum
37 f(color3); // { dg-error "cannot convert" }
38 f2(color); // { dg-error "cannot convert" }
40 f2(i); // { dg-error "cannot convert" }
41 i = color3; // { dg-error "cannot convert" }
42 color3 = i; // { dg-error "cannot convert" }
43 f(static_cast<int>(color3)); // okay
46 a[color3]; // { dg-error "array subscript is not an integer" }
48 bool b = color3; // { dg-error "cannot convert" }
53 Color1 c1 = Color1::Red;
54 Color2 c2 = Color1::Red; // { dg-error "cannot convert" }
55 c2 = Color1::Red; // { dg-error "cannot convert" }
61 template<typename T, T value>
65 int& sfinae(constant<T, T::Green>*);
71 int& test1 = sfinae((constant<Color1, Color1::Green>*)0);
72 int& test2 = sfinae((constant<Color2, Color2::Green>*)0);
73 float& test3 = sfinae((constant<Color1, Color1::Red>*)0);
74 int& test4 = sfinae((constant<Color, Green>*)0);
75 float& test5 = sfinae((constant<Color, Red>*)0);