@@ -126,6 +126,12 @@ void notTriviallyCopyable() {
126
126
::memmove (&p, &vb, sizeof (int ));
127
127
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, source object type 'types::VirtualBase'
128
128
129
+ types::Copy ca[10 ];
130
+ memset (ca, 0 , sizeof (ca));
131
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Copy[10]'
132
+ memset (&ca, 0 , sizeof (ca));
133
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::Copy[10]'
134
+
129
135
#define MEMSET memset (&vf, 0 , sizeof (int ));
130
136
MEMSET
131
137
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'types::VirtualFunc'
@@ -159,6 +165,17 @@ void notTriviallyCopyable() {
159
165
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'aliases::Copy2'
160
166
memset (pc3, 0 , sizeof (int ));
161
167
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3'
168
+ using Copy3Arr = Copy3[5 ];
169
+ Copy3Arr c3a;
170
+ memset (c3a, 0 , sizeof (c3a));
171
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3Arr'
172
+ memset (&c3a, 0 , sizeof (c3a));
173
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3Arr'
174
+
175
+ typedef Copy3 Copy3Arr2[5 ];
176
+ Copy3Arr2 c3a2;
177
+ memset (c3a2, 0 , sizeof (c3a2));
178
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: undefined behavior, destination object type 'Copy3Arr2'
162
179
}
163
180
164
181
void triviallyCopyable () {
0 commit comments