[clang-tidy] Remove hicpp modules [2/4] (#196870)

This is part two of removing the hicpp-* checks.

RFC:
https://discourse.llvm.org/t/rfc-regarding-the-current-status-of-hicpp-checks/89883

Part of https://github.com/llvm/llvm-project/issues/183462
diff --git a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
index 3679b70..8d08e0c 100644
--- a/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
@@ -8,16 +8,11 @@
 
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
-#include "../bugprone/SignedBitwiseCheck.h"
 #include "../bugprone/UndelegatedConstructorCheck.h"
 #include "../bugprone/UnhandledCodePathsCheck.h"
-#include "../bugprone/UseAfterMoveCheck.h"
 #include "../cppcoreguidelines/NoMallocCheck.h"
-#include "../cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.h"
-#include "../cppcoreguidelines/ProTypeMemberInitCheck.h"
 #include "../cppcoreguidelines/ProTypeVarargCheck.h"
 #include "../cppcoreguidelines/SpecialMemberFunctionsCheck.h"
-#include "../misc/NewDeleteOverloadsCheck.h"
 #include "../misc/StaticAssertCheck.h"
 #include "../modernize/UseAutoCheck.h"
 #include "../modernize/UseEmplaceCheck.h"
@@ -26,10 +21,7 @@
 #include "../modernize/UseNoexceptCheck.h"
 #include "../modernize/UseNullptrCheck.h"
 #include "../modernize/UseOverrideCheck.h"
-#include "../performance/MoveConstArgCheck.h"
-#include "../performance/NoexceptMoveConstructorCheck.h"
 #include "../portability/NoAssemblerCheck.h"
-#include "../readability/NamedParameterCheck.h"
 #include "../readability/UppercaseLiteralSuffixCheck.h"
 
 namespace clang::tidy {
@@ -41,23 +33,6 @@
   void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
     CheckFactories.registerCheck<bugprone::UnhandledCodePathsCheck>(
         "hicpp-multiway-paths-covered");
-    CheckFactories.registerCheck<bugprone::SignedBitwiseCheck>(
-        "hicpp-signed-bitwise");
-    CheckFactories.registerCheck<readability::NamedParameterCheck>(
-        "hicpp-named-parameter");
-    CheckFactories.registerCheck<bugprone::UseAfterMoveCheck>(
-        "hicpp-invalid-access-moved");
-    CheckFactories.registerCheck<cppcoreguidelines::ProTypeMemberInitCheck>(
-        "hicpp-member-init");
-    CheckFactories.registerCheck<performance::MoveConstArgCheck>(
-        "hicpp-move-const-arg");
-    CheckFactories.registerCheck<misc::NewDeleteOverloadsCheck>(
-        "hicpp-new-delete-operators");
-    CheckFactories.registerCheck<performance::NoexceptMoveConstructorCheck>(
-        "hicpp-noexcept-move");
-    CheckFactories
-        .registerCheck<cppcoreguidelines::ProBoundsArrayToPointerDecayCheck>(
-            "hicpp-no-array-decay");
     CheckFactories.registerCheck<portability::NoAssemblerCheck>(
         "hicpp-no-assembler");
     CheckFactories.registerCheck<cppcoreguidelines::NoMallocCheck>(
diff --git a/clang-tools-extra/clangd/TidyFastChecks.inc b/clang-tools-extra/clangd/TidyFastChecks.inc
index c1a72ba..e289e3c 100644
--- a/clang-tools-extra/clangd/TidyFastChecks.inc
+++ b/clang-tools-extra/clangd/TidyFastChecks.inc
@@ -272,17 +272,9 @@
 FAST(google-runtime-int, 2.0)
 FAST(google-runtime-operator, 1.0)
 FAST(google-upgrade-googletest-case, 1.0)
-FAST(hicpp-invalid-access-moved, 9.0)
-FAST(hicpp-member-init, 2.0)
-FAST(hicpp-move-const-arg, 2.0)
 FAST(hicpp-multiway-paths-covered, -0.0)
-FAST(hicpp-named-parameter, 1.0)
-FAST(hicpp-new-delete-operators, 1.0)
-FAST(hicpp-no-array-decay, 2.0)
 FAST(hicpp-no-assembler, 1.0)
 FAST(hicpp-no-malloc, 1.0)
-FAST(hicpp-noexcept-move, -0.0)
-FAST(hicpp-signed-bitwise, -1.0)
 FAST(hicpp-special-member-functions, -1.0)
 FAST(hicpp-static-assert, 2.0)
 FAST(hicpp-undelegated-constructor, 1.0)
@@ -492,4 +484,3 @@
 
 #undef FAST
 #undef SLOW
-
diff --git a/clang-tools-extra/clangd/TidyProvider.cpp b/clang-tools-extra/clangd/TidyProvider.cpp
index bfb0835..aae7d6b 100644
--- a/clang-tools-extra/clangd/TidyProvider.cpp
+++ b/clang-tools-extra/clangd/TidyProvider.cpp
@@ -218,8 +218,6 @@
       // code, which is often the case when clangd
       // tries to build an AST.
       "-bugprone-use-after-move",
-      // Alias for bugprone-use-after-move.
-      "-hicpp-invalid-access-moved",
       // Check uses dataflow analysis, which might hang/crash unexpectedly on
       // incomplete code.
       "-bugprone-unchecked-optional-access",
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index c5a6857..241ae52 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -58,9 +58,9 @@
 - Removed the :program:`clang-tidy` ``hicpp`` module. All checks have been moved
   to the other modules. Use the replacement checks instead:
 
-  ================================== =========================================================
+  ================================== ========================================================================
   Removed check                      Replacement check
-  ================================== =========================================================
+  ================================== ========================================================================
   ``hicpp-avoid-c-arrays``           :doc:`modernize-avoid-c-arrays
                                      <clang-tidy/checks/modernize/avoid-c-arrays>`
   ``hicpp-avoid-goto``               :doc:`cppcoreguidelines-avoid-goto
@@ -77,7 +77,23 @@
                                      <clang-tidy/checks/readability/function-size>`
   ``hicpp-ignored-remove-result``    :doc:`bugprone-unused-return-value
                                      <clang-tidy/checks/bugprone/unused-return-value>`
-  ================================== =========================================================
+  ``hicpp-invalid-access-moved``     :doc:`bugprone-use-after-move
+                                     <clang-tidy/checks/bugprone/use-after-move>`
+  ``hicpp-member-init``              :doc:`cppcoreguidelines-pro-type-member-init
+                                     <clang-tidy/checks/cppcoreguidelines/pro-type-member-init>`
+  ``hicpp-move-const-arg``           :doc:`performance-move-const-arg
+                                     <clang-tidy/checks/performance/move-const-arg>`
+  ``hicpp-named-parameter``          :doc:`readability-named-parameter
+                                     <clang-tidy/checks/readability/named-parameter>`
+  ``hicpp-new-delete-operators``     :doc:`misc-new-delete-overloads
+                                     <clang-tidy/checks/misc/new-delete-overloads>`
+  ``hicpp-no-array-decay``           :doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay
+                                     <clang-tidy/checks/cppcoreguidelines/pro-bounds-array-to-pointer-decay>`
+  ``hicpp-noexcept-move``            :doc:`performance-noexcept-move-constructor
+                                     <clang-tidy/checks/performance/noexcept-move-constructor>`
+  ``hicpp-signed-bitwise``           :doc:`bugprone-signed-bitwise
+                                     <clang-tidy/checks/bugprone/signed-bitwise>`
+  ================================== ========================================================================
 
 Improvements to clangd
 ----------------------
@@ -258,11 +274,6 @@
   <clang-tidy/checks/portability/no-assembler>`. The `hicpp-no-assembler`
   name is kept as an alias.
 
-- Renamed :doc:`hicpp-signed-bitwise <clang-tidy/checks/hicpp/signed-bitwise>`
-  to :doc:`bugprone-signed-bitwise
-  <clang-tidy/checks/bugprone/signed-bitwise>`. The `hicpp-signed-bitwise`
-  name is kept as an alias.
-
 - Renamed :doc:`performance-faster-string-find
   <clang-tidy/checks/performance/faster-string-find>` to
   :doc:`performance-prefer-single-char-overloads
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst
deleted file mode 100644
index 05f7968..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. title:: clang-tidy - hicpp-invalid-access-moved
-
-hicpp-invalid-access-moved
-==========================
-
-This check is an alias for
-:doc:`bugprone-use-after-move <../bugprone/use-after-move>`.
-
-Implements parts of the `rule 8.4.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_ to check if moved-from objects are accessed.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/member-init.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/member-init.rst
deleted file mode 100644
index fca19f4..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/member-init.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. title:: clang-tidy - hicpp-member-init
-
-hicpp-member-init
-=================
-
-This check is an alias for :doc:`cppcoreguidelines-pro-type-member-init <../cppcoreguidelines/pro-type-member-init>`.
-Implements the check for
-`rule 12.4.2 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_
-to initialize class members in the right order.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst
deleted file mode 100644
index 6818e7b..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. title:: clang-tidy - hicpp-move-const-arg
-
-hicpp-move-const-arg
-====================
-
-The `hicpp-move-const-arg` check is an alias, please see
-:doc:`performance-move-const-arg <../performance/move-const-arg>`
-for more information.
-It enforces the `rule 17.3.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst
deleted file mode 100644
index 93b5140..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. title:: clang-tidy - hicpp-named-parameter
-
-hicpp-named-parameter
-=====================
-
-This check is an alias for :doc:`readability-named-parameter
-<../readability/named-parameter>`.
-
-Implements `rule 8.2.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/new-delete-operators.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/new-delete-operators.rst
deleted file mode 100644
index dcf3c75..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/new-delete-operators.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-.. title:: clang-tidy - hicpp-new-delete-operators
-
-hicpp-new-delete-operators
-==========================
-
-This check is an alias for :doc:`misc-new-delete-overloads <../misc/new-delete-overloads>`.
-Implements `rule 12.3.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_ to ensure
-the `new` and `delete` operators have the correct signature.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst
deleted file mode 100644
index 9a84fde..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-.. title:: clang-tidy - hicpp-no-array-decay
-
-hicpp-no-array-decay
-====================
-
-The `hicpp-no-array-decay` check is an alias, please see
-:doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay
-<../cppcoreguidelines/pro-bounds-array-to-pointer-decay>`
-for more information.
-It enforces the `rule 4.1.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/noexcept-move.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/noexcept-move.rst
deleted file mode 100644
index dee6294..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/noexcept-move.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-.. title:: clang-tidy - hicpp-noexcept-move
-
-hicpp-noexcept-move
-===================
-
-This check is an alias for :doc:`performance-noexcept-move-constructor
-<../performance/noexcept-move-constructor>`.
-Checks `rule 12.5.4 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-rules>`_ to mark move assignment and move construction `noexcept`.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/signed-bitwise.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/signed-bitwise.rst
deleted file mode 100644
index dca5279..0000000
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/signed-bitwise.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. title:: clang-tidy - hicpp-signed-bitwise
-
-hicpp-signed-bitwise
-====================
-
-The `hicpp-signed-bitwise` check is an alias, please see
-`bugprone-signed-bitwise <../bugprone/signed-bitwise.html>`_ for more
-information.
-
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index f193c09..f80df56 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -603,17 +603,9 @@
    :doc:`google-readability-casting <google/readability-casting>`, :doc:`modernize-avoid-c-style-cast <modernize/avoid-c-style-cast>`, "Yes"
    :doc:`google-readability-function-size <google/readability-function-size>`, :doc:`readability-function-size <readability/function-size>`,
    :doc:`google-readability-namespace-comments <google/readability-namespace-comments>`, :doc:`llvm-namespace-comment <llvm/namespace-comment>`,
-   :doc:`hicpp-invalid-access-moved <hicpp/invalid-access-moved>`, :doc:`bugprone-use-after-move <bugprone/use-after-move>`,
-   :doc:`hicpp-member-init <hicpp/member-init>`, :doc:`cppcoreguidelines-pro-type-member-init <cppcoreguidelines/pro-type-member-init>`, "Yes"
-   :doc:`hicpp-move-const-arg <hicpp/move-const-arg>`, :doc:`performance-move-const-arg <performance/move-const-arg>`, "Yes"
    :doc:`hicpp-multiway-paths-covered <hicpp/multiway-paths-covered>`, :doc:`bugprone-unhandled-code-paths <bugprone/unhandled-code-paths>`,
-   :doc:`hicpp-named-parameter <hicpp/named-parameter>`, :doc:`readability-named-parameter <readability/named-parameter>`, "Yes"
-   :doc:`hicpp-new-delete-operators <hicpp/new-delete-operators>`, :doc:`misc-new-delete-overloads <misc/new-delete-overloads>`,
-   :doc:`hicpp-no-array-decay <hicpp/no-array-decay>`, :doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay <cppcoreguidelines/pro-bounds-array-to-pointer-decay>`,
    :doc:`hicpp-no-assembler <hicpp/no-assembler>`, :doc:`portability-no-assembler <portability/no-assembler>`,
    :doc:`hicpp-no-malloc <hicpp/no-malloc>`, :doc:`cppcoreguidelines-no-malloc <cppcoreguidelines/no-malloc>`,
-   :doc:`hicpp-noexcept-move <hicpp/noexcept-move>`, :doc:`performance-noexcept-move-constructor <performance/noexcept-move-constructor>`, "Yes"
-   :doc:`hicpp-signed-bitwise <hicpp/signed-bitwise>`, :doc:`bugprone-signed-bitwise <bugprone/signed-bitwise>`,
    :doc:`hicpp-special-member-functions <hicpp/special-member-functions>`, :doc:`cppcoreguidelines-special-member-functions <cppcoreguidelines/special-member-functions>`,
    :doc:`hicpp-static-assert <hicpp/static-assert>`, :doc:`misc-static-assert <misc/static-assert>`, "Yes"
    :doc:`hicpp-undelegated-constructor <hicpp/undelegated-constructor>`, :doc:`bugprone-undelegated-constructor <bugprone/undelegated-constructor>`,
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-conflicted-fixes-of-alias-checkers.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-conflicted-fixes-of-alias-checkers.cpp
index 3659081..7549bca 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-conflicted-fixes-of-alias-checkers.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-conflicted-fixes-of-alias-checkers.cpp
@@ -1,23 +1,20 @@
-// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init,hicpp-member-init,modernize-use-emplace,hicpp-use-emplace %t -- \
+// RUN: %check_clang_tidy %s cppcoreguidelines-use-default-member-init,modernize-use-default-member-init %t -- \
 //// RUN:     -config='{CheckOptions: { \
-//// RUN:         cppcoreguidelines-pro-type-member-init.UseAssignment: true, \
+//// RUN:         cppcoreguidelines-use-default-member-init.UseAssignment: true, \
 //// RUN:     }}'
 
 class Foo {
 public:
-  Foo() : _num1(0)
-  // CHECK-MESSAGES: warning: constructor does not initialize these fields: _num2 [cppcoreguidelines-pro-type-member-init,hicpp-member-init]
-  // CHECK-MESSAGES: note: cannot apply fix-it because an alias checker has suggested a different fix-it; please remove one of the checkers ('cppcoreguidelines-pro-type-member-init', 'hicpp-member-init') or ensure they are both configured the same
-  {
-    _num1 = 10;
-  }
+  Foo() : _num(0)
+  // CHECK-MESSAGES: warning: use default member initializer for '_num' [cppcoreguidelines-use-default-member-init,modernize-use-default-member-init]
+  // CHECK-MESSAGES: note: cannot apply fix-it because an alias checker has suggested a different fix-it; please remove one of the checkers ('cppcoreguidelines-use-default-member-init', 'modernize-use-default-member-init') or ensure they are both configured the same
+  {}
 
   int use_the_members() const {
-    return _num1 + _num2;
+    return _num;
   }
 
 private:
-  int _num1;
-  int _num2;
-  // CHECK-FIXES: int _num2;
+  int _num;
+  // CHECK-FIXES: int _num;
 };
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp
index 78a903a..4c5d5a9 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp
@@ -1,39 +1,23 @@
-// RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init,hicpp-member-init,modernize-use-emplace,hicpp-use-emplace %t
-
-namespace std {
-
-template <typename T>
-class vector {
-public:
-  void push_back(const T &) {}
-  void push_back(T &&) {}
-
-  template <typename... Args>
-  void emplace_back(Args &&... args){};
-};
-} // namespace std
+// RUN: %check_clang_tidy %s cppcoreguidelines-use-default-member-init,modernize-use-default-member-init,cppcoreguidelines-explicit-constructor,misc-explicit-constructor %t
 
 class Foo {
 public:
-  Foo() : _num1(0)
-  // CHECK-MESSAGES: warning: constructor does not initialize these fields: _num2 [cppcoreguidelines-pro-type-member-init,hicpp-member-init]
-  {
-    _num1 = 10;
-  }
+  Foo() : _num(0)
+  // CHECK-MESSAGES: warning: use default member initializer for '_num' [cppcoreguidelines-use-default-member-init,modernize-use-default-member-init]
+  {}
 
   int use_the_members() const {
-    return _num1 + _num2;
+    return _num;
   }
 
 private:
-  int _num1;
-  int _num2;
-  // CHECK-FIXES: int _num2{};
+  int _num;
+  // CHECK-FIXES: int _num{0};
 };
 
-void should_use_emplace(std::vector<Foo> &v) {
-  v.push_back(Foo());
-  // CHECK-FIXES: v.emplace_back();
-  // CHECK-MESSAGES: warning: use emplace_back instead of push_back [hicpp-use-emplace,modernize-use-emplace]
-}
-
+class Bar {
+public:
+  Bar(int);
+  // CHECK-MESSAGES: warning: single-argument constructors must be marked explicit to avoid unintentional implicit conversions [cppcoreguidelines-explicit-constructor,misc-explicit-constructor]
+  // CHECK-FIXES: explicit Bar(int);
+};