Index: clang-tidy/hicpp/HICPPTidyModule.cpp =================================================================== --- clang-tidy/hicpp/HICPPTidyModule.cpp +++ clang-tidy/hicpp/HICPPTidyModule.cpp @@ -10,6 +10,19 @@ #include "../ClangTidy.h" #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" +#include "../cppcoreguidelines/ProTypeMemberInitCheck.h" +#include "../cppcoreguidelines/SpecialMemberFunctionsCheck.h" +#include "../google/DefaultArgumentsCheck.h" +#include "../google/ExplicitConstructorCheck.h" +#include "../misc/NewDeleteOverloadsCheck.h" +#include "../misc/NoexceptMoveConstructorCheck.h" +#include "../misc/UndelegatedConstructor.h" +#include "../misc/UseAfterMoveCheck.h" +#include "../modernize/UseEqualsDefaultCheck.h" +#include "../modernize/UseEqualsDeleteCheck.h" +#include "../modernize/UseOverrideCheck.h" +#include "../readability/FunctionSizeCheck.h" +#include "../readability/IdentifierNamingCheck.h" #include "NoAssemblerCheck.h" namespace clang { @@ -21,6 +34,32 @@ void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { CheckFactories.registerCheck( "hicpp-no-assembler"); + CheckFactories.registerCheck( + "hicpp-explicit-conversions"); + CheckFactories.registerCheck( + "hicpp-function-size"); + CheckFactories.registerCheck( + "hicpp-named-parameter"); + CheckFactories.registerCheck( + "hicpp-invalid-access-moved"); + CheckFactories.registerCheck( + "hicpp-member-init"); + CheckFactories.registerCheck( + "hicpp-new-delete-operators"); + CheckFactories.registerCheck( + "hicpp-noexcept-move"); + CheckFactories.registerCheck("hicpp-no-assembler"); + CheckFactories + .registerCheck( + "hicpp-special-member-functions"); + CheckFactories.registerCheck( + "hicpp-undelegated-constructor"); + CheckFactories.registerCheck( + "hicpp-use-equals-default"); + CheckFactories.registerCheck( + "hicpp-use-equals-delete"); + CheckFactories.registerCheck( + "hicpp-use-override"); } }; Index: docs/ReleaseNotes.rst =================================================================== --- docs/ReleaseNotes.rst +++ docs/ReleaseNotes.rst @@ -76,7 +76,12 @@ Finds functions that have more then `ParameterThreshold` parameters and emits a warning. -- New `safety-no-assembler +- New `hicpp` module + + Adds checks that implement the High Integrity C++ Coding Standard and other safety + standards. Many checks are aliased to other modules. + +- New `hicpp-no-assembler `_ check Finds uses of inline assembler. Index: docs/clang-tidy/checks/hicpp-explicit-conversions.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-explicit-conversions.rst @@ -0,0 +1,7 @@ +.. title:: clang-tidy - hicpp-explicit-conversions + +hicpp-explicit-conversions +========================== + +This check is an alias for `google-explicit-constructor `_. +Used to enforce parts of `rule 5.4.1 `_. Index: docs/clang-tidy/checks/hicpp-function-size.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-function-size.rst @@ -0,0 +1,11 @@ +.. title:: clang-tidy - hicpp-function-size + +hicpp-function-size +=================== + +This check is an alias for `readability-function-size `_. +Usefull to enforce multiple sections on function complexity. + +- `rule 8.2.2 `_ +- `rule 8.3.1 `_ +- `rule 8.3.2 `_ Index: docs/clang-tidy/checks/hicpp-invalid-access-moved.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-invalid-access-moved.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-invalid-access-moved + +hicpp-invalid-access-moved +========================== + +This check is an alias for `misc-use-after-move `_. + +Implements parts of the `rule 8.4.1 `_ to check if moved-from objects are accessed. Index: docs/clang-tidy/checks/hicpp-member-init.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-member-init.rst @@ -0,0 +1,9 @@ +.. title:: clang-tidy - hicpp-member-init + +hicpp-member-init +================= + +This check is an alias for `cppcoreguidelines-pro-type-member-init `_. +Implements the check for +`rule 12.4.2 `_ +to initialize class members in the right order. Index: docs/clang-tidy/checks/hicpp-named-parameter.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-named-parameter.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-named-parameter + +hicpp-named-parameter +======================= + +This check is an alias for `readability-named-parameter `_. + +Implements the `rule 8.2.1 `_. Index: docs/clang-tidy/checks/hicpp-new-delete-operators.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-new-delete-operators.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-new-delete-operators + +hicpp-new-delete-operators +========================== + +This check is an alias for `misc-new-delete-overloads `_. +Implements `rule 12.3.1 `_ to overload +`new` and `delete` operators correct. Index: docs/clang-tidy/checks/hicpp-noexcept-move.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-noexcept-move.rst @@ -0,0 +1,7 @@ +.. title:: clang-tidy - hicpp-noexcept-move + +hicpp-noexcept-move +=================== + +This check is an alias for `misc-noexcept-moveconstructor `_. +Checks `rule 12.5.4 `_. +Checks that special member function have the correct signature, according to `rule 12.5.7 `_. Index: docs/clang-tidy/checks/hicpp-undelegated-constructor.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-undelegated-constructor.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-undelegated-construtor + +hicpp-undelegated-constructor +============================= + +This check is an alias for `misc-undelegated-constructor `_. +Tries to implement `rule 12.4.5 `_ based on suspicous function calls. +That will not find every codeduplication and possibility to use delegating constructors. Index: docs/clang-tidy/checks/hicpp-use-equals-default.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-use-equals-default.rst @@ -0,0 +1,7 @@ +.. title:: clang-tidy - hicpp-use-equals-defaults + +hicpp-use-equals-default +======================== + +This check is an alias for `modernize-use-equals-default `_. +Implement `rule 12.5.1 `_ to default special member functions. Index: docs/clang-tidy/checks/hicpp-use-equals-delete.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-use-equals-delete.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-use-equals-delete + +hicpp-use-equals-delete +======================= + +This check is an alias for `modernize-use-equals-delete `_. +Implements `rule 12.5.1 `_ +to default and delete special member functions. Index: docs/clang-tidy/checks/hicpp-use-override.rst =================================================================== --- /dev/null +++ docs/clang-tidy/checks/hicpp-use-override.rst @@ -0,0 +1,8 @@ +.. title:: clang-tidy - hicpp-use-override + +hicpp-use-override +================== + +This check is an alias for `modernize-use-override `_. +Implements `rule 10.2.1 `_ to +declare virtual function `override` when overriding.