diff --git a/.clang-tidy b/.clang-tidy index 021a3eb0..c96e19c9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1 +1,7 @@ -Checks: '-*,clang-diagnostic-*,google-readability-casting,readability-else-after-return,performance-unnecessary-copy-initialization,bugprone-use-after-move,modernize-use-nullptr' +Checks: '-*,clang-diagnostic-*,google-readability-casting,readability-else-after-return,performance-unnecessary-copy-initialization,bugprone-use-after-move,modernize-use-nullptr,modernize-redundant-void-arg,modernize-return-braced-init-list,modernize-use-default-member-init,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nodiscard,modernize-use-override,cppcoreguidelines-avoid-goto,misc-unconventional-assign-operator' +# It would be nice to enable: +# - readability-magic-numbers +# - modernize-avoid-c-arrays +CheckOptions: + - key: modernize-use-default-member-init.UseAssignment + value: '1' diff --git a/src/ds/helpers.h b/src/ds/helpers.h index aa165ab6..2c1014a8 100644 --- a/src/ds/helpers.h +++ b/src/ds/helpers.h @@ -53,10 +53,10 @@ namespace snmalloc return static_cast(value & (length - 1)); } - T& operator=(const T v) + Mod& operator=(const T v) { value = v; - return value; + return *this; } };