Open
Description
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:
- android-cloexec-accept (Nothing found)
- android-cloexec-accept4 (Nothing found)
- android-cloexec-creat (Nothing found)
- android-cloexec-dup (Nothing found)
- android-cloexec-epoll-create (Nothing found)
- android-cloexec-epoll-create1 (Nothing found)
- android-cloexec-fopen (discussion: "e" mode string in fopen #2748, PR: Add
cloexec
option tofopen
#2755, Addcloexec
option tofopen
#3223) - android-cloexec-inotify-init (Nothing found)
- android-cloexec-inotify-init1 (Nothing found)
- android-cloexec-memfd-create (Nothing found)
- android-cloexec-open (discussion: "e" mode string in fopen #2748, PR: Add
cloexec
option tofopen
#2755) - android-cloexec-pipe (Nothing found)
- android-cloexec-pipe2 (Nothing found)
- android-cloexec-socket (Nothing found)
- android-comparison-in-temp-failure-retry (Nothing found)
Boost:
- boost-use-to-string (PR: Prefer
std::to_string
overboost::lexical_cast
for integer conversions #2785)
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:
- modernize-avoid-bind (Nothing found)
- modernize-avoid-c-arrays (PR: Use
std::array
instead of C-array for ColorLUT #4489) -
modernize-concat-nested-namespaces(requires C++17) - modernize-deprecated-headers (PR: Replace deprecated C library headers #2737)
- modernize-deprecated-ios-base-aliases
- modernize-loop-convert (PR: Tranform classic loops to range-based for loops in module 2d #2835, Transform classic loops to range-based for loops in module search #2836, Transform classic loops to range-based for loops in module tracking #2837, Transform classic loops to range-based for loops in module common #2838, Transform classic loops to range-based for loops in module ml #2839, Transform classic loops to range-based for loops in module geometry #2840, Transform classic loops to range-based for loops in examples #2841, Transform classic loops to range-based for loops in module kdtree #2842, Transform classic loops to range-based for loops in module visualization #2843, Transform classic loops to range-based for loops in module gpu #2844, Transform classic loops to range-based for loops in module gpu #2844, Transform classic loops to range-based for loops in module io #2845, Transform classic loops to range-based for loops in module keypoints #2846, Transform classic loops to range-based for loops in module octree #2847, Transform classic loops to range-based for loops in module outofcore #2848, Transform classic loops to range-based for loops in module people #2849, Transform classic loops to range-based for loops in tools #2850, Transform classic loops to range-based for loops in tests. #2851, Transform classic loops to range-based for loops in module features #2853, Transform classic loops to range-based for loops in module filters #2854, Transform classic loops to range-based for loops in module recognition #2855, Transform classic loops to range-based for loops in module registration #2856, Transform classic loops to range-based for loops in module sample_consensus #2857, Transform classic loops to range-based for loops in module simulation #2858, Transform classic loops to range-based for loops in module segmentation #2859, Transform classic loops to range-based for loops in module surface #2860)
- modernize-make-shared (Nothing found)
- modernize-make-unique (Nothing found)
- modernize-pass-by-value
- modernize-raw-string-literal (PR: Prefer raw strings over escaped strings #2789)
- modernize-redundant-void-arg (PR: Remove unnecessary void parameter #2780)
- modernize-replace-auto-ptr (Nothing found)
- modernize-replace-random-shuffle (PR: Replace random_shuffle by shuffle #3069)
- modernize-return-braced-init-list (PR: Prefer returning braced init list #3039)
- modernize-shrink-to-fit (Nothing found)
-
modernize-unary-static-assert(requires C++17) -
modernize-use-auto(developer decision, so no auto transformation, see discussion in Transform classic loops to range-based for loops in module common #2838) - modernize-use-bool-literals (PR: Prefer using
bool
literals #2793) - modernize-use-default-member-init
- modernize-use-emplace (PR: Prefer
emplace_back
overpush_back
#2784) - modernize-use-equals-default (PR: Make empty destructors default or remove them if they seems to be unnecessary #5386)
- modernize-use-equals-delete (PR: Use
=delete
to disable special members #2779) -
modernize-use-nodiscard(requires C++17) - modernize-use-noexcept
- modernize-use-nullptr (PR: Use nullptr in module apps #3004, Use nullptr in module common #3005, Use nullptr in module cuda #3006, Use nullptr in module examples #3007, Use nullptr in module features #3008, Use nullptr in module filters #3009, Use nullptr in module geometry #3010, Use nullptr in module gpu #3011, Use nullptr in module io #3012, Use nullptr in module kdtree #3013, Use nullptr in module keypoints #3014, Use nullptr in module ml #3015, Use nullptr in module octree #3016, Use nullptr in module outofcore #3017, Use nullptr in module people #3018, Use nullptr in module recognition #3019, Use nullptr in module registration #3020, Use nullptr in module sample_consensus #3021, Use nullptr in module search #3022, Use nullptr in module segmentation #3023, Use nullptr in module simulation #3024, Use nullptr in module stereo #3025, Use nullptr in module surface #3026, Use nullptr in module test #3027, Use nullptr in module tools #3028, Use nullptr in module visualization #3029)
- modernize-use-override (PR: Modernize code to use
override
#2728) - modernize-use-trailing-return-type (check not released in a stable version of clang-tidy)
- modernize-use-transparent-functors (PR: Use transparent functors #3224)
-
modernize-use-uncaught-exceptions(requires C++17) - modernize-use-using (PR: Use using instead of typedef [test] #3112, Use using instead of typedef [2d, ml, search] #3113, Use using instead of typedef [tools, tracking, visualization] #3115, Use using instead of typedef [apps] #3117, Use using instead of typedef [common] #3118, Use using instead of typedef [cuda] #3121, Use using instead of typedef [kdtree, keypoints, octree] #3122, Use using instead of typedef [features] #3123, Use using instead of typedef [registration] #3124, Use using instead of typedef [filters] #3125, Use using instead of typedef [simulation, stereo, surface ] #3129, Use using instead of typedef [segmentation] #3130, Use using instead of typedef [out_of_core, people, recognition, sample_consensus] #3132, Use using instead of typedef [gpu] #3134, Use using instead of typedef [geometry] #3137, Use using instead of typedef [io] #3138, Use
using
instead oftypedef
#3139)
MPI
- mpi-buffer-deref (Nothing found)
- mpi-type-mismatch (Nothing found)
OpenMP
- openmp-exception-escape (Nothing found)
- openmp-use-default-none (PR: Use default(none) for OpenMP definitions #3524)
Performance
- performance-faster-string-find (PR: Improve performance of finding single character in strings #2794)
- performance-for-range-copy (Nothing found)
- performance-implicit-conversion-in-loop (requires Adjust code to match current FLANN API #3234)
- performance-inefficient-algorithm (Nothing found)
-
performance-inefficient-string-concatenation(discussion: [Clang-Tidy] Inefficient string concatenation #3233) - performance-inefficient-vector-operation (Nothing found)
- performance-move-const-arg (Nothing found)
- performance-move-constructor-init (Nothing found)
- performance-noexcept-move-constructor (Nothing found)
- performance-type-promotion-in-math-fn (PR: Force C++ over C math function #3087)
- performance-unnecessary-copy-initialization
- performance-unnecessary-value-param (PR: Add missing
std::move
orconst
reference for parameters #3232, Add missingstd::move
orconst
reference for parameters #3253)
Readability:
- readability-avoid-const-params-in-decls
- readability-braces-around-statements
- readability-const-return-type
- readability-container-size-empty (PR: Prefer
empty()
oversize()
when checking container state #3033) - readability-delete-null-pointer (PR: Remove unnecessary
nullptr
checks beforedelete
#2990) - readability-deleted-default (Nothing found)
- readability-else-after-return (PR: Remove else after return statement [2d, apps, common, cuda, examples, features, filters, geometry, gpu] #3180, Remove else after return statement [io] #3181, Remove else after return statement [kdtree, keypoints, ml, octree] #3182, Remove else after return statement [outofcore] #3183, Remove else after return statement [people, recognition, registration] #3184, Remove else after return statement [sample_consensus, search, segmentation, stereo, surface] #3185, Remove else after return statement [test, tools, tracking, visualization] #3186)
- readability-function-size
- readability-identifier-naming (Nothing found)
- readability-implicit-bool-conversion
- readability-inconsistent-declaration-parameter-name
- readability-isolate-declaration
- readability-magic-numbers
- readability-make-member-function-const (PR: Mark non-const and non-modifying member functions as const #3836)
- readability-misleading-indentation
- readability-misplaced-array-index (Nothing found)
- readability-named-parameter
- readability-non-const-parameter
- readability-redundant-control-flow
- readability-redundant-declaration (Nothing found)
- readability-redundant-function-ptr-dereference (Nothing found)
- readability-redundant-member-init (PR: Remove redundant member field initialization #3070)
- readability-redundant-preprocessor (Nothing found)
- readability-redundant-smartptr-get (Nothing found)
- readability-redundant-string-cstr (PR: Remove redundant calls to
std::string::c_str()
#3517) - readability-redundant-string-init (PR: Remove redundant string initialization with
""
#2758) - readability-simplify-boolean-expr (PR: Simplify boolean expressions #2790)
- readability-simplify-subscript-expr
- readability-static-accessed-through-instance (PR: Fix access to static members through instances #2776)
- readability-static-definition-in-anonymous-namespace (Nothing found)
- readability-string-compare (PR: Improve readability of string comparisons #2986)
- readability-uniqueptr-delete-release (Nothing found)
- readability-uppercase-literal-suffix
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.