1 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wduplicate-enum
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -x c++ -DCPP -fsyntax-only -verify -Wduplicate-enum
4 A1
= 0, // expected-note {{element 'A1' also has value 0}}
6 A3
, // expected-warning {{element 'A3' has been implicitly assigned 0 which another element has been assigned}}
10 B1
= -1, // expected-note {{element 'B1' also has value -1}}
11 B2
, // expected-warning {{element 'B2' has been implicitly assigned 0 which another element has been assigned}}
14 B5
, // expected-warning {{element 'B5' has been implicitly assigned -1 which another element has been assigned}}
15 B6
// expected-note {{element 'B6' also has value 0}}
18 enum C
{ C1
, C2
= -1, C3
}; // expected-warning{{element 'C1' has been implicitly assigned 0 which another element has been assigned}} \
19 // expected-note {{element 'C3' also has value 0}}
24 D3
, // expected-warning{{element 'D3' has been implicitly assigned 2 which another element has been assigned}}
25 D4
= D2
, // no warning
26 D5
= 2 // expected-note {{element 'D5' also has value 2}}
64 enum { J1
, J2
= -1, J3
};
96 VALUE
// expected-note{{previous definition is here}}
100 VALUE
// expected-error{{redefinition of enumerator 'VALUE'}}
104 enum BigEnumerators
: long {