6
6
// RUN: }}'
7
7
8
8
enum 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
11
11
EError_a = 1 ,
12
12
EError_b ,
13
13
// CHECK-FIXES: EError_b = 2,
@@ -34,8 +34,8 @@ enum EAll {
34
34
35
35
#define ENUMERATOR_1 EMacro1_b
36
36
enum 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
39
39
EMacro1_a = 1 ,
40
40
ENUMERATOR_1 ,
41
41
// CHECK-FIXES: ENUMERATOR_1 = 2,
@@ -45,8 +45,8 @@ enum EMacro1 {
45
45
46
46
#define ENUMERATOR_2 EMacro2_b = 2
47
47
enum 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
50
50
EMacro2_a = 1 ,
51
51
ENUMERATOR_2 ,
52
52
EMacro2_c ,
@@ -78,3 +78,40 @@ enum EnumSequentialInitialValue {
78
78
EnumSequentialInitialValue_2 = 4 ,
79
79
// CHECK-FIXES-ENABLE: EnumSequentialInitialValue_2 ,
80
80
};
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