clang-tools-extra/docs/clang-tidy/checks/performance/trivially-destructible.rst
raw| 1 | .. title:: clang-tidy - performance-trivially-destructible |
| 2 | |
| 3 | performance-trivially-destructible |
| 4 | ================================== |
| 5 | |
| 6 | Finds types that could be made trivially-destructible by removing out-of-line |
| 7 | defaulted destructor declarations. |
| 8 | |
| 9 | .. code-block:: c++ |
| 10 | |
| 11 | struct A: TrivialType { |
| 12 | ~A(); // Makes A non-trivially-destructible. |
| 13 | TrivialType trivial_fields; |
| 14 | }; |
| 15 | A::~A() = default; |