[clang-tidy] Skip private default ctors in modernize-use-equals-default
For c++17 (i.e. before c++20) making a private default ctor explicitly defaulted might expose the previously intentionally disallowed initializations, e.g. class Tag { Tag() {} friend class Widget; }; is not equivalent to class Tag { Tag() = default; friend class Widget; }; since in the latter case Tag is treated as an aggregate despite having a declaration of the default constructor. This diff makes modernize-use-equals-default skip in-class empty nonpublic default ctors to avoid code breakages. Test plan: ninja check-all Differential revision: https://reviews.llvm.org/D136224
Loading
Please sign in to comment