Skip to content

Commit 19aefd2

Browse files
committed
[clang-tidy] Deprecate readability-deleted-default check
... For removal in next release cycle. The clang warning that does the same thing is enabled by default and typically emits better diagnostics making this check surplus to requirements. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97491
1 parent e7080aa commit 19aefd2

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ Changes in existing checks
112112
function or assignment to ``nullptr``.
113113
Added support for pointers to ``std::unique_ptr``.
114114

115+
Deprecated checks
116+
^^^^^^^^^^^^^^^^^
117+
118+
- The :doc:`readability-deleted-default
119+
<clang-tidy/checks/readability-deleted-default>` check has been deprecated.
120+
121+
The clang warning `Wdefaulted-function-deleted
122+
<https://clang.llvm.org/docs/DiagnosticsReference.html#wdefaulted-function-deleted>`_
123+
will diagnose the same issues and is enabled by default.
124+
115125
Improvements to include-fixer
116126
-----------------------------
117127

clang-tools-extra/docs/clang-tidy/checks/readability-deleted-default.rst

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
readability-deleted-default
44
===========================
55

6-
Checks that constructors and assignment operators marked as ``= default`` are
7-
not actually deleted by the compiler.
8-
9-
.. code-block:: c++
10-
11-
class Example {
12-
public:
13-
// This constructor is deleted because I is missing a default value.
14-
Example() = default;
15-
// This is fine.
16-
Example(const Example& Other) = default;
17-
// This operator is deleted because I cannot be assigned (it is const).
18-
Example& operator=(const Example& Other) = default;
19-
20-
private:
21-
const int I;
22-
};
6+
This check has been deprecated prefer to make use of the `Wdefaulted-function-deleted
7+
<https://clang.llvm.org/docs/DiagnosticsReference.html#wdefaulted-function-deleted>`_
8+
flag.

0 commit comments

Comments
 (0)