@@ -24,12 +24,16 @@ S2 s21{.i=1, .j =2};
24
24
25
25
S2 s22 = {1 , 2 };
26
26
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
27
- // CHECK-MESSAGES-POD: :[[@LINE-2]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
27
+ // CHECK-MESSAGES: :[[@LINE-6]]:1: note: this is the type to initialize
28
+ // CHECK-MESSAGES-POD: :[[@LINE-3]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
29
+ // CHECK-MESSAGES-POD: :[[@LINE-8]]:1: note: this is the type to initialize
28
30
// CHECK-FIXES: S2 s22 = {.i=1, .j=2};
29
31
30
32
S2 s23{1 };
31
33
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use designated initializer list [modernize-use-designated-initializers]
32
- // CHECK-MESSAGES-POD: :[[@LINE-2]]:7: warning: use designated initializer list [modernize-use-designated-initializers]
34
+ // CHECK-MESSAGES: :[[@LINE-13]]:1: note: this is the type to initialize
35
+ // CHECK-MESSAGES-POD: :[[@LINE-3]]:7: warning: use designated initializer list [modernize-use-designated-initializers]
36
+ // CHECK-MESSAGES-POD: :[[@LINE-15]]:1: note: this is the type to initialize
33
37
// CHECK-FIXES: S2 s23{.i=1};
34
38
35
39
S2 s24{.i = 1 };
@@ -54,16 +58,20 @@ S3 s31 = {.s2 = 1, 2, 3.1};
54
58
55
59
S3 s32 = {{.i = 1 , 2 }};
56
60
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
57
- // CHECK-MESSAGES: :[[@LINE-2]]:20: warning: use designated init expression [modernize-use-designated-initializers]
58
- // CHECK-MESSAGES-POD: :[[@LINE-3]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
59
- // CHECK-MESSAGES-POD: :[[@LINE-4]]:20: warning: use designated init expression [modernize-use-designated-initializers]
61
+ // CHECK-MESSAGES: :[[@LINE-15]]:1: note: this is the type to initialize
62
+ // CHECK-MESSAGES: :[[@LINE-3]]:20: warning: use designated init expression [modernize-use-designated-initializers]
63
+ // CHECK-MESSAGES-POD: :[[@LINE-4]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
64
+ // CHECK-MESSAGES-POD: :[[@LINE-18]]:1: note: this is the type to initialize
65
+ // CHECK-MESSAGES-POD: :[[@LINE-6]]:20: warning: use designated init expression [modernize-use-designated-initializers]
60
66
// CHECK-FIXES: S3 s32 = {.s2={.i = 1, .j=2}};
61
67
62
68
S3 s33 = {{2 }, .d =3.1 };
63
69
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: use designated init expression [modernize-use-designated-initializers]
64
70
// CHECK-MESSAGES: :[[@LINE-2]]:11: warning: use designated initializer list [modernize-use-designated-initializers]
65
- // CHECK-MESSAGES-POD: :[[@LINE-3]]:11: warning: use designated init expression [modernize-use-designated-initializers]
66
- // CHECK-MESSAGES-POD: :[[@LINE-4]]:11: warning: use designated initializer list [modernize-use-designated-initializers]
71
+ // CHECK-MESSAGES: :[[@LINE-50]]:1: note: this is the type to initialize
72
+ // CHECK-MESSAGES-POD: :[[@LINE-4]]:11: warning: use designated init expression [modernize-use-designated-initializers]
73
+ // CHECK-MESSAGES-POD: :[[@LINE-5]]:11: warning: use designated initializer list [modernize-use-designated-initializers]
74
+ // CHECK-MESSAGES-POD: :[[@LINE-53]]:1: note: this is the type to initialize
67
75
// CHECK-FIXES: S3 s33 = {.s2={.i=2}, .d=3.1};
68
76
69
77
struct S4 {
@@ -73,10 +81,12 @@ struct S4 {
73
81
74
82
S4 s41 {2.2 };
75
83
// CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-1]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
84
+ // CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-7]]:1: note: this is the type to initialize
76
85
// CHECK-FIXES-SINGLE-ELEMENT: S4 s41 {.d=2.2};
77
86
78
87
S4 s42 = {{}};
79
88
// CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
89
+ // CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-12]]:1: note: this is the type to initialize
80
90
// CHECK-FIXES-SINGLE-ELEMENT: S4 s42 = {.d={}};
81
91
82
92
template <typename S> S template1 () { return {10 , 11 }; }
@@ -98,7 +108,9 @@ struct S6 {
98
108
99
109
S6 s61 {1 , 2 };
100
110
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
101
- // CHECK-MESSAGES-POD: :[[@LINE-2]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
111
+ // CHECK-MESSAGES: :[[@LINE-7]]:1: note: this is the type to initialize
112
+ // CHECK-MESSAGES-POD: :[[@LINE-3]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
113
+ // CHECK-MESSAGES-POD: :[[@LINE-9]]:1: note: this is the type to initialize
102
114
// CHECK-FIXES: S6 s61 {.i=1, .s.j=2};
103
115
104
116
struct S7 {
@@ -110,6 +122,7 @@ struct S7 {
110
122
111
123
S7 s71 {1 };
112
124
// CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-1]]:8: warning: use designated initializer list [modernize-use-designated-initializers]
125
+ // CHECK-MESSAGES-SINGLE-ELEMENT: :[[@LINE-9]]:1: note: this is the type to initialize
113
126
// CHECK-FIXES-SINGLE-ELEMENT: S7 s71 {.u.k=1};
114
127
115
128
struct S8 : S7 { int i; };
@@ -123,6 +136,7 @@ struct S9 {
123
136
124
137
S9 s91{1 , 2 };
125
138
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: use designated initializer list [modernize-use-designated-initializers]
139
+ // CHECK-MESSAGES: :[[@LINE-7]]:1: note: this is the type to initialize
126
140
// CHECK-FIXES: S9 s91{.i=1, .j=2};
127
141
128
142
struct S10 { int i = 1 , j = 2 ; };
@@ -136,6 +150,7 @@ struct S11 { int i; S10 s10; };
136
150
S11 s111 { .i = 1 };
137
151
S11 s112 { 1 };
138
152
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
153
+ // CHECK-MESSAGES: :[[@LINE-5]]:1: note: this is the type to initialize
139
154
// CHECK-FIXES: S11 s112 { .i=1 };
140
155
141
156
S11 s113 { .i =1 , {}};
@@ -153,7 +168,9 @@ struct S12 {
153
168
154
169
S12 s121 {1 , 2 };
155
170
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
156
- // CHECK-MESSAGES-POD: :[[@LINE-2]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
171
+ // CHECK-MESSAGES: :[[@LINE-7]]:1: note: this is the type to initialize
172
+ // CHECK-MESSAGES-POD: :[[@LINE-3]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
173
+ // CHECK-MESSAGES-POD: :[[@LINE-9]]:1: note: this is the type to initialize
157
174
// CHECK-FIXES: S12 s121 {.i=1, .j=2};
158
175
159
176
struct S13 {
@@ -166,7 +183,9 @@ struct S13 {
166
183
167
184
S13 s131 {1 , 2 };
168
185
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
169
- // CHECK-MESSAGES-POD: :[[@LINE-2]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
186
+ // CHECK-MESSAGES: :[[@LINE-10]]:1: note: this is the type to initialize
187
+ // CHECK-MESSAGES-POD: :[[@LINE-3]]:10: warning: use designated initializer list [modernize-use-designated-initializers]
188
+ // CHECK-MESSAGES-POD: :[[@LINE-12]]:1: note: this is the type to initialize
170
189
// CHECK-FIXES: S13 s131 {.k=1, .i=2};
171
190
172
191
#define A (3 +2 )
@@ -181,3 +200,4 @@ S9 s92 {A, B};
181
200
DECLARE_S93;
182
201
// CHECK-MESSAGES-MACROS: :[[@LINE-1]]:1: warning: use designated initializer list [modernize-use-designated-initializers]
183
202
// CHECK-MESSAGES-MACROS: :[[@LINE-4]]:28: note: expanded from macro 'DECLARE_S93'
203
+ // CHECK-MESSAGES-MACROS: :[[@LINE-71]]:1: note: this is the type to initialize
0 commit comments