File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,8 @@ struct HeapArray { // Ok, since destruc
309
309
310
310
HeapArray (HeapArray &&other) : _data(other._data), size(other.size) { // Ok
311
311
other._data = nullptr ; // Ok
312
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: expected assignment source to be of type 'gsl::owner<>'; got 'std::nullptr_t'
313
+ // FIXME: This warning is emitted because an ImplicitCastExpr for the NullToPointer conversion isn't created for dependent types.
312
314
other.size = 0 ;
313
315
}
314
316
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ template <class T>
260
260
struct Template {
261
261
Template () = default ;
262
262
Template (const Template &Other) : Field(Other.Field) {}
263
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use '= default'
264
+ // CHECK-FIXES: Template(const Template &Other) = default;
263
265
Template &operator =(const Template &Other);
264
266
void foo (const T &t);
265
267
int Field;
@@ -269,8 +271,12 @@ Template<T> &Template<T>::operator=(const Template<T> &Other) {
269
271
Field = Other.Field ;
270
272
return *this ;
271
273
}
274
+ // CHECK-MESSAGES: :[[@LINE-4]]:27: warning: use '= default'
275
+ // CHECK-FIXES: Template<T> &Template<T>::operator=(const Template<T> &Other) = default;
276
+
272
277
Template<int > T1;
273
278
279
+
274
280
// Dependent types.
275
281
template <class T >
276
282
struct DT1 {
@@ -284,6 +290,9 @@ DT1<T> &DT1<T>::operator=(const DT1<T> &Other) {
284
290
Field = Other.Field ;
285
291
return *this ;
286
292
}
293
+ // CHECK-MESSAGES: :[[@LINE-4]]:17: warning: use '= default'
294
+ // CHECK-FIXES: DT1<T> &DT1<T>::operator=(const DT1<T> &Other) = default;
295
+
287
296
DT1<int > Dt1;
288
297
289
298
template <class T >
@@ -303,6 +312,9 @@ DT2<T> &DT2<T>::operator=(const DT2<T> &Other) {
303
312
struct T {
304
313
typedef int TT;
305
314
};
315
+ // CHECK-MESSAGES: :[[@LINE-8]]:17: warning: use '= default'
316
+ // CHECK-FIXES: DT2<T> &DT2<T>::operator=(const DT2<T> &Other) = default;
317
+
306
318
DT2<T> Dt2;
307
319
308
320
// Default arguments.
You can’t perform that action at this time.
0 commit comments