Skip to content
Commit 90d42b1c authored by Alexander Shaposhnikov's avatar Alexander Shaposhnikov
Browse files

[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
parent ba8ded68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment