Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1558618

Browse files
authored
[clang-tidy] Remove hicpp module [1/4] (#194516)
This is part one of removing the `hicpp-*` checks. RFC: https://discourse.llvm.org/t/rfc-regarding-the-current-status-of-hicpp-checks/89883 Part of #183462
1 parent 3be2eaa commit 1558618

16 files changed

Lines changed: 30 additions & 164 deletions

File tree

clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@
99
#include "../ClangTidy.h"
1010
#include "../ClangTidyModule.h"
1111
#include "../bugprone/SignedBitwiseCheck.h"
12-
#include "../bugprone/StdExceptionBaseclassCheck.h"
1312
#include "../bugprone/UndelegatedConstructorCheck.h"
14-
#include "../bugprone/UnusedReturnValueCheck.h"
1513
#include "../bugprone/UseAfterMoveCheck.h"
16-
#include "../cppcoreguidelines/AvoidGotoCheck.h"
1714
#include "../cppcoreguidelines/NoMallocCheck.h"
1815
#include "../cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h"
1916
#include "../cppcoreguidelines/ProTypeMemberInitCheck.h"
2017
#include "../cppcoreguidelines/ProTypeVarargCheck.h"
2118
#include "../cppcoreguidelines/SpecialMemberFunctionsCheck.h"
22-
#include "../misc/ExplicitConstructorCheck.h"
2319
#include "../misc/NewDeleteOverloadsCheck.h"
2420
#include "../misc/StaticAssertCheck.h"
25-
#include "../modernize/AvoidCArraysCheck.h"
26-
#include "../modernize/DeprecatedHeadersCheck.h"
2721
#include "../modernize/UseAutoCheck.h"
2822
#include "../modernize/UseEmplaceCheck.h"
2923
#include "../modernize/UseEqualsDefaultCheck.h"
@@ -34,8 +28,6 @@
3428
#include "../performance/MoveConstArgCheck.h"
3529
#include "../performance/NoexceptMoveConstructorCheck.h"
3630
#include "../portability/NoAssemblerCheck.h"
37-
#include "../readability/BracesAroundStatementsCheck.h"
38-
#include "../readability/FunctionSizeCheck.h"
3931
#include "../readability/NamedParameterCheck.h"
4032
#include "../readability/UppercaseLiteralSuffixCheck.h"
4133
#include "MultiwayPathsCoveredCheck.h"
@@ -47,26 +39,10 @@ namespace {
4739
class HICPPModule : public ClangTidyModule {
4840
public:
4941
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
50-
CheckFactories.registerCheck<modernize::AvoidCArraysCheck>(
51-
"hicpp-avoid-c-arrays");
52-
CheckFactories.registerCheck<cppcoreguidelines::AvoidGotoCheck>(
53-
"hicpp-avoid-goto");
54-
CheckFactories.registerCheck<readability::BracesAroundStatementsCheck>(
55-
"hicpp-braces-around-statements");
56-
CheckFactories.registerCheck<modernize::DeprecatedHeadersCheck>(
57-
"hicpp-deprecated-headers");
58-
CheckFactories.registerCheck<bugprone::StdExceptionBaseclassCheck>(
59-
"hicpp-exception-baseclass");
60-
CheckFactories.registerCheck<bugprone::UnusedReturnValueCheck>(
61-
"hicpp-ignored-remove-result");
6242
CheckFactories.registerCheck<MultiwayPathsCoveredCheck>(
6343
"hicpp-multiway-paths-covered");
6444
CheckFactories.registerCheck<bugprone::SignedBitwiseCheck>(
6545
"hicpp-signed-bitwise");
66-
CheckFactories.registerCheck<misc::ExplicitConstructorCheck>(
67-
"hicpp-explicit-conversions");
68-
CheckFactories.registerCheck<readability::FunctionSizeCheck>(
69-
"hicpp-function-size");
7046
CheckFactories.registerCheck<readability::NamedParameterCheck>(
7147
"hicpp-named-parameter");
7248
CheckFactories.registerCheck<bugprone::UseAfterMoveCheck>(
@@ -111,16 +87,6 @@ class HICPPModule : public ClangTidyModule {
11187
CheckFactories.registerCheck<cppcoreguidelines::ProTypeVarargCheck>(
11288
"hicpp-vararg");
11389
}
114-
115-
ClangTidyOptions getModuleOptions() override {
116-
ClangTidyOptions Options;
117-
ClangTidyOptions::OptionMap &Opts = Options.CheckOptions;
118-
Opts["hicpp-ignored-remove-result.CheckedFunctions"] =
119-
"^::std::remove$;^::std::remove_if$;^::std::unique$";
120-
Opts["hicpp-ignored-remove-result.CheckedReturnTypes"] = "";
121-
Opts["hicpp-ignored-remove-result.AllowCastToVoid"] = "true";
122-
return Options;
123-
}
12490
};
12591

12692
} // namespace

clang-tools-extra/clangd/TidyFastChecks.inc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,6 @@ FAST(google-runtime-float, 1.0)
272272
FAST(google-runtime-int, 2.0)
273273
FAST(google-runtime-operator, 1.0)
274274
FAST(google-upgrade-googletest-case, 1.0)
275-
FAST(hicpp-avoid-c-arrays, 2.0)
276-
FAST(hicpp-avoid-goto, -0.0)
277-
FAST(hicpp-braces-around-statements, 1.0)
278-
FAST(hicpp-deprecated-headers, -0.0)
279-
FAST(hicpp-exception-baseclass, 1.0)
280-
FAST(hicpp-explicit-conversions, 2.0)
281-
FAST(hicpp-function-size, 1.0)
282-
FAST(hicpp-ignored-remove-result, 2.0)
283275
FAST(hicpp-invalid-access-moved, 9.0)
284276
FAST(hicpp-member-init, 2.0)
285277
FAST(hicpp-move-const-arg, 2.0)

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,30 @@ Potentially Breaking Changes
5555
<clang-tidy/checks/performance/prefer-single-char-overloads>`.
5656
The original check will be removed in the 25th release.
5757

58+
- Removed the :program:`clang-tidy` ``hicpp`` module. All checks have been moved
59+
to the other modules. Use the replacement checks instead:
60+
61+
================================== =========================================================
62+
Removed check Replacement check
63+
================================== =========================================================
64+
``hicpp-avoid-c-arrays`` :doc:`modernize-avoid-c-arrays
65+
<clang-tidy/checks/modernize/avoid-c-arrays>`
66+
``hicpp-avoid-goto`` :doc:`cppcoreguidelines-avoid-goto
67+
<clang-tidy/checks/cppcoreguidelines/avoid-goto>`
68+
``hicpp-braces-around-statements`` :doc:`readability-braces-around-statements
69+
<clang-tidy/checks/readability/braces-around-statements>`
70+
``hicpp-deprecated-headers`` :doc:`modernize-deprecated-headers
71+
<clang-tidy/checks/modernize/deprecated-headers>`
72+
``hicpp-exception-baseclass`` :doc:`bugprone-std-exception-baseclass
73+
<clang-tidy/checks/bugprone/std-exception-baseclass>`
74+
``hicpp-explicit-conversions`` :doc:`misc-explicit-constructor
75+
<clang-tidy/checks/misc/explicit-constructor>`
76+
``hicpp-function-size`` :doc:`readability-function-size
77+
<clang-tidy/checks/readability/function-size>`
78+
``hicpp-ignored-remove-result`` :doc:`bugprone-unused-return-value
79+
<clang-tidy/checks/bugprone/unused-return-value>`
80+
================================== =========================================================
81+
5882
Improvements to clangd
5983
----------------------
6084

@@ -207,7 +231,7 @@ New checks
207231
New check aliases
208232
^^^^^^^^^^^^^^^^^
209233

210-
- New alias :doc:`cert-exp45-c <clang-tidy/checks/cert/exp45-c>`
234+
- Renamed :doc:`cert-exp45-c <clang-tidy/checks/cert/exp45-c>`
211235
to :doc:`bugprone-assignment-in-selection-statement
212236
<clang-tidy/checks/bugprone/assignment-in-selection-statement>`.
213237

@@ -223,18 +247,6 @@ New check aliases
223247
<clang-tidy/checks/misc/explicit-constructor>`. The
224248
`google-explicit-constructor` name is kept as an alias.
225249

226-
- Renamed :doc:`hicpp-exception-baseclass
227-
<clang-tidy/checks/hicpp/exception-baseclass>`
228-
to :doc:`bugprone-std-exception-baseclass
229-
<clang-tidy/checks/bugprone/std-exception-baseclass>`.
230-
The `hicpp-exception-baseclass` name is kept as an alias.
231-
232-
- Renamed :doc:`hicpp-ignored-remove-result
233-
<clang-tidy/checks/hicpp/ignored-remove-result>`
234-
to :doc:`bugprone-unused-return-value
235-
<clang-tidy/checks/bugprone/unused-return-value>`.
236-
The `hicpp-ignored-remove-result` name is kept as an alias.
237-
238250
- Renamed :doc:`hicpp-no-assembler <clang-tidy/checks/hicpp/no-assembler>`
239251
to :doc:`portability-no-assembler
240252
<clang-tidy/checks/portability/no-assembler>`. The `hicpp-no-assembler`

clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,3 @@ Options
6767

6868
:doc:`cert-err33-c <../cert/err33-c>` is an alias of this check that checks a
6969
fixed and large set of standard library functions.
70-
71-
:doc:`hicpp-ignored-remove-result <../hicpp/ignored-remove-result>` is an
72-
alias of this check that checks a restricted set of functions:
73-
``std::remove``, ``std::remove_if``, and ``std::unique``.
74-
The `AllowCastToVoid` option is set to `true` by default.

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-goto.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ with looping constructs. Only forward jumps in nested loops are accepted.
88

99
This check implements `ES.76
1010
<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es76-avoid-goto>`_
11-
from the C++ Core Guidelines and
12-
`6.3.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_
13-
from High Integrity C++ Coding Standard.
11+
from the C++ Core Guidelines.
1412

1513
For more information on why to avoid programming
1614
with ``goto`` you can read the famous paper `A Case against the GO TO Statement. <https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF>`_.

clang-tools-extra/docs/clang-tidy/checks/hicpp/avoid-c-arrays.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/hicpp/avoid-goto.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/hicpp/deprecated-headers.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang-tools-extra/docs/clang-tidy/checks/hicpp/exception-baseclass.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)