1// RUN: %check_clang_tidy -std=c++98 %s cppcoreguidelines-special-member-functions %t
2
3class DefinesDestructor {
4 ~DefinesDestructor();
5};
6// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesDestructor' defines a destructor but does not define a copy constructor or a copy assignment operator [cppcoreguidelines-special-member-functions]
7
8class DefinesCopyConstructor {
9 DefinesCopyConstructor(const DefinesCopyConstructor &);
10};
11// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesCopyConstructor' defines a copy constructor but does not define a destructor or a copy assignment operator [cppcoreguidelines-special-member-functions]
12
13class DefinesCopyAssignment {
14 DefinesCopyAssignment &operator=(const DefinesCopyAssignment &);
15};
16// CHECK-MESSAGES: [[@LINE-3]]:7: warning: class 'DefinesCopyAssignment' defines a copy assignment operator but does not define a destructor or a copy constructor [cppcoreguidelines-special-member-functions]
17
18class DefinesNothing {
19};
20
21class DefinesEverything {
22 DefinesEverything(const DefinesEverything &);
23 DefinesEverything &operator=(const DefinesEverything &);
24 ~DefinesEverything();
25};
26
27

source code of clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/special-member-functions-cxx-03.cpp