[clang-tidy] Tweak 'rule of 3/5' checks to allow defaulting a destructor outside the class.
A somewhat common code-pattern is to default a destructor in the source file and not in the header. For example, this is the way to use smart pointers with forward-declared classes: ```c++ struct Impl; struct A { ~A(); // Can't be defaulted in the header. private: std::unique_ptr<Impl> impl; }; ``` To be able to use this check with this pattern, I modified the behavior with `AllowSoleDefaultDtor` to not trigger on destructors if they aren't defined yet. Since a declared destructor should still be defined somewhere in the program, this won't miss bad classes, just diagnose on less translation units. Reviewed By: carlosgalvezp Differential Revision: https://reviews.llvm.org/D143851
Loading
Please sign in to comment