mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 22:17:02 +07:00
fix some tidy test warnings
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Checks: '-*,
|
||||
|
||||
bugprone-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
|
||||
clang-analyzer-*,
|
||||
|
||||
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -5,7 +5,6 @@
|
||||
"--clang-tidy",
|
||||
"--compile-commands-dir=${workspaceFolder}/.clangd",
|
||||
"--completion-style=detailed",
|
||||
"--cross-file-rename",
|
||||
"--header-insertion=never"
|
||||
],
|
||||
"cmake.copyCompileCommands": "${workspaceFolder}/.clangd/compile_commands.json"
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
---
|
||||
Checks: '-*,
|
||||
|
||||
bugprone-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
|
||||
clang-analyzer-*,
|
||||
|
||||
concurrency-*,
|
||||
|
||||
cppcoreguidelines-*,
|
||||
-cppcoreguidelines-avoid-c-arrays,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-cppcoreguidelines-special-member-functions,
|
||||
|
||||
modernize-*,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-use-nodiscard,
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
---
|
||||
Checks: '-*,
|
||||
|
||||
bugprone-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
|
||||
clang-analyzer-*,
|
||||
|
||||
concurrency-*,
|
||||
|
||||
cppcoreguidelines-*,
|
||||
-cppcoreguidelines-avoid-c-arrays,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-cppcoreguidelines-special-member-functions,
|
||||
|
||||
modernize-*,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-use-nodiscard,
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace
|
||||
struct A {
|
||||
A() = default;
|
||||
|
||||
A(A&&) = default;
|
||||
A(const A&) = default;
|
||||
[[maybe_unused]] A(A&&) = default;
|
||||
[[maybe_unused]]A(const A&) = default;
|
||||
|
||||
A& operator=(A&&) = delete;
|
||||
A& operator=(const A&) = delete;
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace
|
||||
int x{};
|
||||
int y{};
|
||||
|
||||
explicit ivec2(int v) : x{v}, y{v} {}
|
||||
ivec2(int x, int y) : x{x}, y{y} {}
|
||||
[[maybe_unused]] explicit ivec2(int v) : x{v}, y{v} {}
|
||||
[[maybe_unused]] ivec2(int x, int y) : x{x}, y{y} {}
|
||||
|
||||
ivec2& add(const ivec2& other) noexcept {
|
||||
x += other.x;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace
|
||||
{
|
||||
struct class_t {
|
||||
class_t() = default;
|
||||
class_t(int i): member_v{i} {}
|
||||
[[maybe_unused]] class_t(int i): member_v{i} {}
|
||||
|
||||
int member_v{};
|
||||
void method_v() {}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace
|
||||
float base_clazz_2::base_variable_2 = 2.0f;
|
||||
|
||||
struct derived_clazz : base_clazz_1, base_clazz_2 {
|
||||
derived_clazz(int i, float f)
|
||||
[[maybe_unused]] derived_clazz(int i, float f)
|
||||
: base_clazz_1{i}
|
||||
, base_clazz_2{f} {}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace
|
||||
A() = default;
|
||||
virtual ~A() = default;
|
||||
|
||||
A(A&&) noexcept { ++move_ctors_; }
|
||||
A(const A&) { ++copy_ctors_; }
|
||||
[[maybe_unused]] A(A&&) noexcept { ++move_ctors_; }
|
||||
[[maybe_unused]] A(const A&) { ++copy_ctors_; }
|
||||
|
||||
A& operator=(A&&) = delete;
|
||||
A& operator=(const A&) = delete;
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace
|
||||
int x{};
|
||||
int y{};
|
||||
|
||||
explicit ivec2(int v) : x{v}, y{v} {}
|
||||
ivec2(int x, int y) : x{x}, y{y} {}
|
||||
[[maybe_unused]] explicit ivec2(int v) : x{v}, y{v} {}
|
||||
[[maybe_unused]] ivec2(int x, int y) : x{x}, y{y} {}
|
||||
|
||||
ivec2& add(const ivec2& other) noexcept {
|
||||
x += other.x;
|
||||
|
||||
@@ -13,10 +13,11 @@ namespace
|
||||
int y{};
|
||||
|
||||
ivec2() = delete;
|
||||
explicit ivec2(int v): x{v}, y{v} {}
|
||||
ivec2(int x, int y): x{x}, y{y} {}
|
||||
|
||||
ivec2(ivec2&& other) noexcept
|
||||
[[maybe_unused]] explicit ivec2(int v): x{v}, y{v} {}
|
||||
[[maybe_unused]] ivec2(int x, int y): x{x}, y{y} {}
|
||||
|
||||
[[maybe_unused]] ivec2(ivec2&& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
other.x = 0;
|
||||
@@ -24,7 +25,7 @@ namespace
|
||||
++move_constructor_counter;
|
||||
}
|
||||
|
||||
ivec2(const ivec2& other) noexcept
|
||||
[[maybe_unused]] ivec2(const ivec2& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
++copy_constructor_counter;
|
||||
@@ -49,10 +50,11 @@ namespace
|
||||
int dummy[42]{};
|
||||
|
||||
ivec2_big() = delete;
|
||||
explicit ivec2_big(int v): x{v}, y{v} {}
|
||||
ivec2_big(int x, int y): x{x}, y{y} {}
|
||||
|
||||
ivec2_big(ivec2_big&& other) noexcept
|
||||
[[maybe_unused]] explicit ivec2_big(int v): x{v}, y{v} {}
|
||||
[[maybe_unused]] ivec2_big(int x, int y): x{x}, y{y} {}
|
||||
|
||||
[[maybe_unused]] ivec2_big(ivec2_big&& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
other.x = 0;
|
||||
@@ -60,7 +62,7 @@ namespace
|
||||
++move_constructor_counter;
|
||||
}
|
||||
|
||||
ivec2_big(const ivec2_big& other) noexcept
|
||||
[[maybe_unused]] ivec2_big(const ivec2_big& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
++copy_constructor_counter;
|
||||
|
||||
@@ -13,10 +13,11 @@ namespace
|
||||
int y{};
|
||||
|
||||
ivec2() = delete;
|
||||
explicit ivec2(int v): x{v}, y{v} {}
|
||||
ivec2(int x, int y): x{x}, y{y} {}
|
||||
|
||||
ivec2(ivec2&& other) noexcept
|
||||
[[maybe_unused]] explicit ivec2(int v): x{v}, y{v} {}
|
||||
[[maybe_unused]] ivec2(int x, int y): x{x}, y{y} {}
|
||||
|
||||
[[maybe_unused]] ivec2(ivec2&& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
other.x = 0;
|
||||
@@ -24,7 +25,7 @@ namespace
|
||||
++move_constructor_counter;
|
||||
}
|
||||
|
||||
ivec2(const ivec2& other) noexcept
|
||||
[[maybe_unused]] ivec2(const ivec2& other) noexcept
|
||||
: x{other.x}
|
||||
, y{other.y} {
|
||||
++copy_constructor_counter;
|
||||
@@ -49,8 +50,9 @@ namespace
|
||||
int z{};
|
||||
|
||||
ivec3() = delete;
|
||||
explicit ivec3(int v): x{v}, y{v}, z{v} {}
|
||||
ivec3(int x, int y, int z): x{x}, y{y}, z{z} {}
|
||||
|
||||
[[maybe_unused]] explicit ivec3(int v): x{v}, y{v}, z{v} {}
|
||||
[[maybe_unused]] ivec3(int x, int y, int z): x{x}, y{y}, z{z} {}
|
||||
};
|
||||
|
||||
int ivec2::move_constructor_counter{0};
|
||||
|
||||
Reference in New Issue
Block a user