66// RUN: }}'
77
88enum EError {
9- // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: inital values in enum 'EError' are not consistent
10- // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: inital values in enum 'EError' are not consistent
9+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: initial values in enum 'EError' are not consistent
10+ // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: initial values in enum 'EError' are not consistent
1111 EError_a = 1 ,
1212 EError_b ,
1313 // CHECK-FIXES: EError_b = 2,
@@ -34,8 +34,8 @@ enum EAll {
3434
3535#define ENUMERATOR_1 EMacro1_b
3636enum EMacro1 {
37- // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: inital values in enum 'EMacro1' are not consistent
38- // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: inital values in enum 'EMacro1' are not consistent
37+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: initial values in enum 'EMacro1' are not consistent
38+ // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: initial values in enum 'EMacro1' are not consistent
3939 EMacro1_a = 1 ,
4040 ENUMERATOR_1 ,
4141 // CHECK-FIXES: ENUMERATOR_1 = 2,
@@ -45,8 +45,8 @@ enum EMacro1 {
4545
4646#define ENUMERATOR_2 EMacro2_b = 2
4747enum EMacro2 {
48- // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: inital values in enum 'EMacro2' are not consistent
49- // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: inital values in enum 'EMacro2' are not consistent
48+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: initial values in enum 'EMacro2' are not consistent
49+ // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: initial values in enum 'EMacro2' are not consistent
5050 EMacro2_a = 1 ,
5151 ENUMERATOR_2 ,
5252 EMacro2_c ,
@@ -78,3 +78,40 @@ enum EnumSequentialInitialValue {
7878 EnumSequentialInitialValue_2 = 4 ,
7979 // CHECK-FIXES-ENABLE: EnumSequentialInitialValue_2 ,
8080};
81+
82+ // gh107590
83+ enum WithFwdDeclInconsistent : int ;
84+
85+ enum WithFwdDeclInconsistent : int {
86+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: initial values in enum 'WithFwdDeclInconsistent' are not consistent
87+ // CHECK-MESSAGES-ENABLE: :[[@LINE-2]]:1: warning: initial values in enum 'WithFwdDeclInconsistent' are not consistent
88+ EFI0 ,
89+ // CHECK-FIXES: EFI0 = 0,
90+ EFI1 = 1 ,
91+ EFI2 ,
92+ // CHECK-FIXES: EFI2 = 2,
93+ };
94+
95+ enum WithFwdDeclZeroFirst : int ;
96+
97+ enum WithFwdDeclZeroFirst : int {
98+ // CHECK-MESSAGES-ENABLE: :[[@LINE+1]]:3: warning: zero initial value for the first enumerator in 'WithFwdDeclZeroFirst' can be disregarded
99+ EFZ0 = 0 ,
100+ // CHECK-FIXES-ENABLE: EFZ0 ,
101+ EFZ1 ,
102+ EFZ2 ,
103+ };
104+
105+
106+ enum WithFwdDeclSequential : int ;
107+
108+ enum WithFwdDeclSequential : int {
109+ // CHECK-MESSAGES-ENABLE: :[[@LINE-1]]:1: warning: sequential initial value in 'WithFwdDeclSequential' can be ignored
110+ EFS0 = 2 ,
111+ // CHECK-FIXES-ENABLE: EFS0 = 2,
112+ EFS1 = 3 ,
113+ // CHECK-FIXES-ENABLE: EFS1 ,
114+ EFS2 = 4 ,
115+ // CHECK-FIXES-ENABLE: EFS2 ,
116+ };
117+
0 commit comments