<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79826>79826</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy check cppcoreguidelines-special-member-functions falsely demands all members when only destructor virtual and default
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
FalcoGer
</td>
</tr>
</table>
<pre>
[C21 of CppCoreGuidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-five) states in the first good example, that it is acceptable to define a destructor as defaulted and not any other member function, if the only purpose is to make it virtual.
> Example, good
> When a destructor needs to be declared just to make it virtual, it can be defined as defaulted.
However clang-tidy marks the example provided as missing special member functions.
```c++
class AbstractBase {
// ^~~~~~~~~~~~
// Class 'AbstractBase' defines a default destructor but does not define a copy constructor,
// a copy assignment operator, a move constructor or a move assignment operator
// (clang-tidy cppcoreguidelines-special-member-functions)
public:
virtual void Foo() = 0; // at least one abstract method to make the class abstract
virtual ~AbstractBase() = default;
// ...
};
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVD2T4jgQ_TUi6YIysj1A4GCAYS--5GJZamPtyJJL3WaPZH_7lWzzNTvJUSoopFZ_vPf0FJE9e8RKlHtRHhdq4DbE6qScDj8wLupgrunsINcQGjj0_SFE_DFYg856JFEehdy2zD2J_F3Ik5AnS0H3_epsuR3qlQ1Cnv689-1e_rdeNvaCQu6AWDESWA_cIjQ2EsM5BAP4r-p6h0IegFvFYBksgdIae1a1Q-AABhvrERQYJI6D5hBBUdpWg2M0oLwBHxiUv0LgFiN02NUYoRm8Zht8Sm-bsXbw7gr9EPtAmEpxgE59Yip8sZEH5VYiO4rsff7OP-Dj0WPq-XHwT4v-tS2PaMacNYJB7VREAz8H4m_qjE0xaOWn6DSkeRnspZO_wi-8YATtlD8v2ZordCp-0jjVDCP0MVysmdJ0lsj6M1CP2ir3FRN6nfMtm5YWcp_WuKudIoL3mjgqzXtFCGIzn03yAFF-_H58Xo4A4DAmEHLznEPIzTwujeiN0z6jWA8MJiCNpN7Z16G_gg7-Fibk4Wu5OWh6Bx16htBjVFMwKOjCBZ9TQFLStPvdnS_Zhdw-ga_7XoeI57vilzPQywno5R1oIXfPUPdD7axOD2z8mzLPioBLsAZOIQi5Ta9G5EfIRL5PpccmFINDRQwhITJDCh1yG8xdYUkPE3G3iD8L_X7l415tJkPk-8edufZqdRPM5ng__yKehalys8t3aoHVepO9lXm5k9tFWxXbbfFWFvW6MVnRZDqvJeK6RIOqaMpcL2wlM1lka7lb50UpN6u3rc6LdW1qNBlu6lIUGXbKupVzl24V4nlhiQasNrutfFs4VaOj0fekfJAkpEw-GKt0aVkPZxJF5iwxPdKwZYfVM7Et6s__QS80yhG6KxjslDcEyt0eG8GvZBGj5zzp-8ZC8q0Z8cUQXfXqvLPl6tAJeUrtzj_LPoafqHk0ZxpG-x1R-C8AAP___lP5Pg">