remove interface warning tuning

This commit is contained in:
BlackMATov
2022-07-01 22:47:50 +07:00
parent 04dae2799f
commit 83fd973f55
13 changed files with 47 additions and 48 deletions

View File

@@ -3,6 +3,7 @@ Checks: '-*,
bugprone-*, bugprone-*,
-bugprone-easily-swappable-parameters, -bugprone-easily-swappable-parameters,
-bugprone-forwarding-reference-overload,
clang-analyzer-*, clang-analyzer-*,
@@ -20,6 +21,7 @@ Checks: '-*,
portability-*, portability-*,
readability-*, readability-*,
-readability-identifier-length,
-readability-redundant-access-specifiers, -readability-redundant-access-specifiers,
-readability-use-anyofallof, -readability-use-anyofallof,
' '

View File

@@ -18,27 +18,6 @@ target_include_directories(${PROJECT_NAME} INTERFACE headers)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads) target_link_libraries(${PROJECT_NAME} INTERFACE Threads::Threads)
target_compile_options(${PROJECT_NAME}
INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:
>
INTERFACE
$<$<CXX_COMPILER_ID:GNU>:
>
INTERFACE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-covered-switch-default
-Wno-exit-time-destructors
-Wno-global-constructors
-Wno-padded
-Wno-shadow-field-in-constructor
-Wno-unknown-warning-option
-Wno-unused-macros
-Wno-weak-vtables
>)
# #
# BUILD_AS_STANDALONE # BUILD_AS_STANDALONE
# #

View File

@@ -135,8 +135,8 @@ namespace enum_hpp::detail
struct ignore_assign final { struct ignore_assign final {
Enum value; Enum value;
constexpr explicit ignore_assign(Enum value) noexcept constexpr explicit ignore_assign(Enum nvalue) noexcept
: value(value) {} : value(nvalue) {}
template < typename Other > template < typename Other >
// NOLINTNEXTLINE(readability-named-parameter) // NOLINTNEXTLINE(readability-named-parameter)

View File

@@ -209,9 +209,8 @@ namespace meta_hpp::detail
return std::is_convertible_v<noncopyable&&, copy_cvref_t<To, noncopyable>>; return std::is_convertible_v<noncopyable&&, copy_cvref_t<To, noncopyable>>;
case ref_types::const_rvalue: case ref_types::const_rvalue:
return std::is_convertible_v<const noncopyable&&, copy_cvref_t<To, noncopyable>>; return std::is_convertible_v<const noncopyable&&, copy_cvref_t<To, noncopyable>>;
default:
return false;
} }
return false;
}; };
if ( is_a(to_type, from_type) && is_convertible() ) { if ( is_a(to_type, from_type) && is_convertible() ) {
@@ -230,9 +229,8 @@ namespace meta_hpp::detail
return std::is_constructible_v<To, to_raw_type&&> && can_cast_to<to_raw_type&&>(); return std::is_constructible_v<To, to_raw_type&&> && can_cast_to<to_raw_type&&>();
case ref_types::const_rvalue: case ref_types::const_rvalue:
return std::is_constructible_v<To, const to_raw_type&&> && can_cast_to<const to_raw_type&&>(); return std::is_constructible_v<To, const to_raw_type&&> && can_cast_to<const to_raw_type&&>();
default:
return false;
} }
return false;
}; };
if ( is_a(to_type, from_type) && is_constructible() ) { if ( is_a(to_type, from_type) && is_constructible() ) {

View File

@@ -163,9 +163,8 @@ namespace meta_hpp::detail
return std::is_invocable_v<inst_method, inst_class&&>; return std::is_invocable_v<inst_method, inst_class&&>;
case ref_types::const_rvalue: case ref_types::const_rvalue:
return std::is_invocable_v<inst_method, const inst_class&&>; return std::is_invocable_v<inst_method, const inst_class&&>;
default:
return false;
} }
return false;
}; };
return is_a(to_type, from_type) && is_invocable(); return is_a(to_type, from_type) && is_invocable();

View File

@@ -476,9 +476,9 @@ namespace meta_hpp::detail
metadata_map metadata; metadata_map metadata;
explicit type_data_base(type_id id, type_kind kind) explicit type_data_base(type_id nid, type_kind nkind)
: id{id} : id{nid}
, kind{kind} {} , kind{nkind} {}
}; };
struct array_type_data final : type_data_base { struct array_type_data final : type_data_base {

View File

@@ -23,7 +23,17 @@ target_compile_options(${PROJECT_NAME}
-Werror -Wall -Wextra -Wpedantic> -Werror -Wall -Wextra -Wpedantic>
PRIVATE PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>: $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Werror -Weverything -Wconversion>) -Werror -Weverything -Wconversion
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-exit-time-destructors
-Wno-padded
-Wno-unknown-warning-option
-Wno-unneeded-internal-declaration
-Wno-unneeded-member-function
-Wno-unused-macros
-Wno-weak-vtables
>)
target_compile_definitions(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE
DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS

View File

@@ -23,7 +23,18 @@ target_compile_options(${PROJECT_NAME}
-Werror -Wall -Wextra -Wpedantic> -Werror -Wall -Wextra -Wpedantic>
PRIVATE PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>: $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Werror -Weverything -Wconversion>) -Werror -Weverything -Wconversion
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-exit-time-destructors
-Wno-global-constructors
-Wno-padded
-Wno-unknown-warning-option
-Wno-unneeded-internal-declaration
-Wno-unneeded-member-function
-Wno-unused-macros
-Wno-weak-vtables
>)
target_compile_definitions(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE
DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS

View File

@@ -12,8 +12,8 @@ namespace
struct clazz { struct clazz {
int i{}; int i{};
clazz(int i) clazz(int ni)
: i{i} { : i{ni} {
++constructor_counter; ++constructor_counter;
} }

View File

@@ -18,8 +18,8 @@ namespace
int x{}; int x{};
int y{}; int y{};
[[maybe_unused]] explicit ivec2(int v) : x{v}, y{v} {} [[maybe_unused]] explicit ivec2(int nv) : x{nv}, y{nv} {}
[[maybe_unused]] ivec2(int x, int y) : x{x}, y{y} {} [[maybe_unused]] ivec2(int nx, int ny) : x{nx}, y{ny} {}
ivec2& add(const ivec2& other) noexcept { ivec2& add(const ivec2& other) noexcept {
x += other.x; x += other.x;

View File

@@ -20,8 +20,8 @@ namespace
int x{}; int x{};
int y{}; int y{};
[[maybe_unused]] explicit ivec2(int v) : x{v}, y{v} {} [[maybe_unused]] explicit ivec2(int nv) : x{nv}, y{nv} {}
[[maybe_unused]] ivec2(int x, int y) : x{x}, y{y} {} [[maybe_unused]] ivec2(int nx, int ny) : x{nx}, y{ny} {}
ivec2& add(const ivec2& other) noexcept { ivec2& add(const ivec2& other) noexcept {
x += other.x; x += other.x;

View File

@@ -14,8 +14,8 @@ namespace
ivec2() = delete; ivec2() = delete;
[[maybe_unused]] explicit ivec2(int v): x{v}, y{v} {} [[maybe_unused]] explicit ivec2(int nv): x{nv}, y{nv} {}
[[maybe_unused]] ivec2(int x, int y): x{x}, y{y} {} [[maybe_unused]] ivec2(int nx, int ny): x{nx}, y{ny} {}
[[maybe_unused]] ivec2(ivec2&& other) noexcept [[maybe_unused]] ivec2(ivec2&& other) noexcept
: x{other.x} : x{other.x}
@@ -51,8 +51,8 @@ namespace
ivec2_big() = delete; ivec2_big() = delete;
[[maybe_unused]] explicit ivec2_big(int v): x{v}, y{v} {} [[maybe_unused]] explicit ivec2_big(int nv): x{nv}, y{nv} {}
[[maybe_unused]] ivec2_big(int x, int y): x{x}, y{y} {} [[maybe_unused]] ivec2_big(int nx, int ny): x{nx}, y{ny} {}
[[maybe_unused]] ivec2_big(ivec2_big&& other) noexcept [[maybe_unused]] ivec2_big(ivec2_big&& other) noexcept
: x{other.x} : x{other.x}

View File

@@ -14,8 +14,8 @@ namespace
ivec2() = delete; ivec2() = delete;
[[maybe_unused]] explicit ivec2(int v): x{v}, y{v} {} [[maybe_unused]] explicit ivec2(int nv): x{nv}, y{nv} {}
[[maybe_unused]] ivec2(int x, int y): x{x}, y{y} {} [[maybe_unused]] ivec2(int nx, int ny): x{nx}, y{ny} {}
[[maybe_unused]] ivec2(ivec2&& other) noexcept [[maybe_unused]] ivec2(ivec2&& other) noexcept
: x{other.x} : x{other.x}
@@ -51,8 +51,8 @@ namespace
ivec3() = delete; ivec3() = delete;
[[maybe_unused]] explicit ivec3(int v): x{v}, y{v}, z{v} {} [[maybe_unused]] explicit ivec3(int nv): x{nv}, y{nv}, z{nv} {}
[[maybe_unused]] ivec3(int x, int y, int z): x{x}, y{y}, z{z} {} [[maybe_unused]] ivec3(int nx, int ny, int nz): x{nx}, y{ny}, z{nz} {}
}; };
int ivec2::move_constructor_counter{0}; int ivec2::move_constructor_counter{0};