Skip to content

[Overview] Modernization code with clang-tidy #2731

Open
@SunBlack

Description

@SunBlack

This issue is just to have an overview about clang-tidy modernizations.

Full list of clang-tidy checks.

Checks which redirect to another test are removed from following list.

Android:

Boost:

Bugprone:

  • bugprone-argument-comment (Nothing found)
  • bugprone-assert-side-effect (Nothing found)
  • bugprone-bool-pointer-implicit-conversion
  • bugprone-branch-clone (Nothing found)
  • bugprone-copy-constructor-init
  • bugprone-dangling-handle (Nothing found)
  • bugprone-exception-escape
  • bugprone-fold-init-type (Nothing found)
  • bugprone-forward-declaration-namespace
  • bugprone-forwarding-reference-overload (Nothing found)
  • bugprone-inaccurate-erase (Nothing found)
  • bugprone-incorrect-roundings
  • bugprone-integer-division
  • bugprone-lambda-function-name (Nothing found)
  • bugprone-macro-parentheses
  • bugprone-macro-repeated-side-effects (Nothing found)
  • bugprone-misplaced-operator-in-strlen-in-alloc (Nothing found)
  • bugprone-misplaced-widening-cast
  • bugprone-move-forwarding-reference (Nothing found)
  • bugprone-multiple-statement-macro
  • bugprone-narrowing-conversions
  • bugprone-parent-virtual-call
  • bugprone-posix-return (Nothing found)
  • bugprone-sizeof-container (Nothing found)
  • bugprone-sizeof-expression
  • bugprone-string-constructor (Nothing found)
  • bugprone-string-integer-assignment (Nothing found)
  • bugprone-string-literal-with-embedded-nul (Nothing found)
  • bugprone-suspicious-enum-usage
  • bugprone-suspicious-memset-usage (Nothing found)
  • bugprone-suspicious-missing-comma (Nothing found)
  • bugprone-suspicious-semicolon (Nothing found)
  • bugprone-suspicious-string-compare
  • bugprone-swapped-arguments (Nothing found)
  • bugprone-terminating-continue (Nothing found)
  • bugprone-throw-keyword-missing (Nothing found)
  • bugprone-too-small-loop-variable (PR: Fix bug prone loop variables that are too small #2829)
  • bugprone-undefined-memory-manipulation
  • bugprone-undelegated-constructor (Nothing found)
  • bugprone-unhandled-self-assignment (Nothing found)
  • bugprone-unused-raii (Nothing found)
  • bugprone-unused-return-value (Nothing found)
  • bugprone-use-after-move (Nothing found)
  • bugprone-virtual-near-miss

Cert:

  • cert-dcl21-cpp
  • cert-dcl50-cpp
  • cert-dcl58-cpp (Nothing found)
  • cert-env33-c (Nothing found)
  • cert-err34-c
  • cert-err52-cpp
  • cert-err58-cpp
  • cert-err60-cpp
  • cert-flp30-c
  • cert-msc50-cpp
  • cert-msc51-cpp
  • cert-oop11-cp (Nothing found)

Clang-Analyzer:

  • clang-analyzer-apiModeling.StdCLibraryFunctions (Nothing found)
  • clang-analyzer-apiModeling.TrustNonnull (Nothing found)
  • clang-analyzer-apiModeling.google.GTest (Nothing found)
  • clang-analyzer-core.CallAndMessage
  • clang-analyzer-core.DivideZero
  • clang-analyzer-core.DynamicTypePropagation (Nothing found)
  • clang-analyzer-core.NonNullParamChecker
  • clang-analyzer-core.NonnilStringConstants (Nothing found)
  • clang-analyzer-core.NullDereference
  • clang-analyzer-core.StackAddressEscape (Nothing found)
  • clang-analyzer-core.UndefinedBinaryOperatorResult (Nothing found)
  • clang-analyzer-core.VLASize (Nothing found)
  • clang-analyzer-core.builtin.BuiltinFunctions (Nothing found)
  • clang-analyzer-core.builtin.NoReturnFunctions (Nothing found)
  • clang-analyzer-core.uninitialized.ArraySubscript
  • clang-analyzer-core.uninitialized.Assign
  • clang-analyzer-core.uninitialized.Branch
  • clang-analyzer-core.uninitialized.CapturedBlockVariable (Nothing found)
  • clang-analyzer-core.uninitialized.UndefReturn
  • clang-analyzer-cplusplus.InnerPointer (Nothing found)
  • clang-analyzer-cplusplus.Move (Nothing found)
  • clang-analyzer-cplusplus.NewDelete
  • clang-analyzer-cplusplus.NewDeleteLeaks
  • clang-analyzer-cplusplus.SelfAssignment (Nothing found)
  • clang-analyzer-deadcode.DeadStores (PR: Remove dead stores #3095)
  • clang-analyzer-llvm.Conventions (check not released in a stable version of clang-tidy)
  • clang-analyzer-nullability.NullPassedToNonnull (Nothing found)
  • clang-analyzer-nullability.NullReturnedFromNonnull (Nothing found)
  • clang-analyzer-nullability.NullableDereferenced (Nothing found)
  • clang-analyzer-nullability.NullablePassedToNonnull (Nothing found)
  • clang-analyzer-nullability.NullableReturnedFromNonnull (Nothing found)
  • clang-analyzer-optin.cplusplus.VirtualCall
  • clang-analyzer-optin.mpi.MPI-Checker (Nothing found)
  • clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker (Nothing found)
  • clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker (Nothing found)
  • clang-analyzer-optin.performance.GCDAntipattern (Nothing found)
  • clang-analyzer-optin.performance.Padding
  • clang-analyzer-optin.portability.UnixAPI (Nothing found)
  • clang-analyzer-osx.API (Nothing found)
  • clang-analyzer-osx.NumberObjectConversion (Nothing found)
  • clang-analyzer-osx.OSObjectRetainCount (Nothing found)
  • clang-analyzer-osx.ObjCProperty (Nothing found)
  • clang-analyzer-osx.SecKeychainAPI (Nothing found)
  • clang-analyzer-osx.cocoa.AtSync (Nothing found)
  • clang-analyzer-osx.cocoa.AutoreleaseWrite (Nothing found)
  • clang-analyzer-osx.cocoa.ClassRelease (Nothing found)
  • clang-analyzer-osx.cocoa.Dealloc (Nothing found)
  • clang-analyzer-osx.cocoa.IncompatibleMethodTypes (Nothing found)
  • clang-analyzer-osx.cocoa.Loops (Nothing found)
  • clang-analyzer-osx.cocoa.MissingSuperCall (Nothing found)
  • clang-analyzer-osx.cocoa.NSAutoreleasePool (Nothing found)
  • clang-analyzer-osx.cocoa.NSError (Nothing found)
  • clang-analyzer-osx.cocoa.NilArg (Nothing found)
  • clang-analyzer-osx.cocoa.NonNilReturnValue (Nothing found)
  • clang-analyzer-osx.cocoa.ObjCGenerics (Nothing found)
  • clang-analyzer-osx.cocoa.RetainCount (Nothing found)
  • clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak (Nothing found)
  • clang-analyzer-osx.cocoa.SelfInit (Nothing found)
  • clang-analyzer-osx.cocoa.SuperDealloc (Nothing found)
  • clang-analyzer-osx.cocoa.UnusedIvars (Nothing found)
  • clang-analyzer-osx.cocoa.VariadicMethodTypes (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFError (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFNumber (Nothing found)
  • clang-analyzer-osx.coreFoundation.CFRetainRelease (Nothing found)
  • clang-analyzer-osx.coreFoundation.containers.OutOfBounds (Nothing found)
  • clang-analyzer-osx.coreFoundation.containers.PointerSizedValues (Nothing found)
  • clang-analyzer-security.FloatLoopCounter
  • clang-analyzer-security.insecureAPI.UncheckedReturn (Nothing found)
  • clang-analyzer-security.insecureAPI.bcmp (Nothing found)
  • clang-analyzer-security.insecureAPI.bcopy (Nothing found)
  • clang-analyzer-security.insecureAPI.bzero (Nothing found)
  • clang-analyzer-security.insecureAPI.getpw (Nothing found)
  • clang-analyzer-security.insecureAPI.gets (Nothing found)
  • clang-analyzer-security.insecureAPI.mkstemp (Nothing found)
  • clang-analyzer-security.insecureAPI.mktemp (Nothing found)
  • clang-analyzer-security.insecureAPI.rand (Nothing found)
  • clang-analyzer-security.insecureAPI.strcpy
  • clang-analyzer-security.insecureAPI.vfork (Nothing found)
  • clang-analyzer-unix.API
  • clang-analyzer-unix.Malloc
  • clang-analyzer-unix.MallocSizeof (Nothing found)
  • clang-analyzer-unix.MismatchedDeallocator
  • clang-analyzer-unix.StdCLibraryFunctions (check not released in a stable version of clang-tidy)
  • clang-analyzer-unix.Vfork (Nothing found)
  • clang-analyzer-unix.cstring.BadSizeArg (Nothing found)
  • clang-analyzer-unix.cstring.NullArg (Nothing found)
  • clang-analyzer-valist.CopyToSelf (Nothing found)
  • clang-analyzer-valist.Uninitialized (Nothing found)
  • clang-analyzer-valist.Unterminated (Nothing found)

cppcoreguidelines

  • cppcoreguidelines-avoid-goto
  • cppcoreguidelines-interfaces-global-init (Nothing found)
  • cppcoreguidelines-macro-usage
  • cppcoreguidelines-narrowing-conversions
  • cppcoreguidelines-no-malloc
  • cppcoreguidelines-owning-memory
  • cppcoreguidelines-pro-bounds-array-to-pointer-decay
  • cppcoreguidelines-pro-bounds-constant-array-index
  • cppcoreguidelines-pro-bounds-pointer-arithmetic
  • cppcoreguidelines-pro-type-const-cast
  • cppcoreguidelines-pro-type-cstyle-cast
  • cppcoreguidelines-pro-type-member-init
  • cppcoreguidelines-pro-type-reinterpret-cast
  • cppcoreguidelines-pro-type-static-cast-downcast
  • cppcoreguidelines-pro-type-union-access
  • cppcoreguidelines-pro-type-vararg
  • cppcoreguidelines-slicing
  • cppcoreguidelines-special-member-functions

hicpp:

  • hicpp-avoid-goto
  • hicpp-exception-baseclass
  • hicpp-multiway-paths-covered
  • hicpp-no-assembler (Nothing found)
  • hicpp-signed-bitwise

Misc:

  • misc-definitions-in-headers
  • misc-misplaced-const
  • misc-new-delete-overloads (Nothing found)
  • misc-non-copyable-objects (Nothing found)
  • misc-non-private-member-variables-in-classes
  • misc-redundant-expression
  • misc-static-assert (Nothing found)
  • misc-throw-by-value-catch-by-reference (Nothing found)
  • misc-unconventional-assign-operator
  • misc-uniqueptr-reset-release (Nothing found)
  • misc-unused-alias-decls (Nothing found)
  • misc-unused-parameters
  • misc-unused-using-decls

Modernize:

MPI

  • mpi-buffer-deref (Nothing found)
  • mpi-type-mismatch (Nothing found)

OpenMP

Performance

Readability:

Not relevant checks:

  • abseil-*
  • fuchsia-*
  • google-*
  • llvm-*
  • objc-*
  • portability-simd-intrinsics (experimental part of std)
  • zircon-*

In case you see a modernization we could apply or can't apply, feel free to write it as comment. In case there is a modernization that needs discussion, open a new issue and write reference to it as comment, so I can add it to this list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions