Skip to content

Commit 66578f1

Browse files
committed
[FOLD] update clang-tidy tests
1 parent 6f36495 commit 66578f1

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/owning-memory.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ struct HeapArray { // Ok, since destruc
309309

310310
HeapArray(HeapArray &&other) : _data(other._data), size(other.size) { // Ok
311311
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.
312314
other.size = 0;
313315
}
314316

clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default-copy.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ template <class T>
260260
struct Template {
261261
Template() = default;
262262
Template(const Template &Other) : Field(Other.Field) {}
263+
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use '= default'
264+
// CHECK-FIXES: Template(const Template &Other) = default;
263265
Template &operator=(const Template &Other);
264266
void foo(const T &t);
265267
int Field;
@@ -269,8 +271,12 @@ Template<T> &Template<T>::operator=(const Template<T> &Other) {
269271
Field = Other.Field;
270272
return *this;
271273
}
274+
// CHECK-MESSAGES: :[[@LINE-4]]:27: warning: use '= default'
275+
// CHECK-FIXES: Template<T> &Template<T>::operator=(const Template<T> &Other) = default;
276+
272277
Template<int> T1;
273278

279+
274280
// Dependent types.
275281
template <class T>
276282
struct DT1 {
@@ -284,6 +290,9 @@ DT1<T> &DT1<T>::operator=(const DT1<T> &Other) {
284290
Field = Other.Field;
285291
return *this;
286292
}
293+
// CHECK-MESSAGES: :[[@LINE-4]]:17: warning: use '= default'
294+
// CHECK-FIXES: DT1<T> &DT1<T>::operator=(const DT1<T> &Other) = default;
295+
287296
DT1<int> Dt1;
288297

289298
template <class T>
@@ -303,6 +312,9 @@ DT2<T> &DT2<T>::operator=(const DT2<T> &Other) {
303312
struct T {
304313
typedef int TT;
305314
};
315+
// CHECK-MESSAGES: :[[@LINE-8]]:17: warning: use '= default'
316+
// CHECK-FIXES: DT2<T> &DT2<T>::operator=(const DT2<T> &Other) = default;
317+
306318
DT2<T> Dt2;
307319

308320
// Default arguments.

0 commit comments

Comments
 (0)