You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang-tidy] Add AllowImplicitlyDeletedCopyOrMove option to cppcoreguidelines-special-member-functions (#71683)
Improved cppcoreguidelines-special-member-functions check with a new
option AllowImplicitlyDeletedCopyOrMove, which removes the requirement
for explicit copy or move special member functions when they are already
implicitly deleted.
Closes#62392
// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesMoveConstructor' defines a move constructor but does not define a destructor, a copy constructor, a copy assignment operator or a move assignment operator [cppcoreguidelines-special-member-functions]
37
+
// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesMoveConstructor' defines a move constructor but does not define a destructor or a move assignment operator [cppcoreguidelines-special-member-functions]
// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesMoveAssignment' defines a move assignment operator but does not define a destructor, a copy constructor, a copy assignment operator or a move constructor [cppcoreguidelines-special-member-functions]
42
+
// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesMoveAssignment' defines a move assignment operator but does not define a destructor or a move constructor [cppcoreguidelines-special-member-functions]
43
+
43
44
classDefinesNothing {
44
45
};
45
46
@@ -81,3 +82,22 @@ struct TemplateClass {
81
82
// This should not cause problems.
82
83
TemplateClass<int> InstantiationWithInt;
83
84
TemplateClass<double> InstantiationWithDouble;
85
+
86
+
structNoCopy
87
+
{
88
+
NoCopy() = default;
89
+
~NoCopy() = default;
90
+
91
+
NoCopy(const NoCopy&) = delete;
92
+
NoCopy(NoCopy&&) = delete;
93
+
94
+
NoCopy& operator=(const NoCopy&) = delete;
95
+
NoCopy& operator=(NoCopy&&) = delete;
96
+
};
97
+
98
+
// CHECK-MESSAGES: [[@LINE+1]]:8: warning: class 'NonCopyable' defines a copy constructor but does not define a destructor or a copy assignment operator [cppcoreguidelines-special-member-functions]
0 commit comments