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

View File

@@ -18,27 +18,6 @@ target_include_directories(${PROJECT_NAME} INTERFACE headers)
find_package(Threads REQUIRED)
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
#

View File

@@ -135,8 +135,8 @@ namespace enum_hpp::detail
struct ignore_assign final {
Enum value;
constexpr explicit ignore_assign(Enum value) noexcept
: value(value) {}
constexpr explicit ignore_assign(Enum nvalue) noexcept
: value(nvalue) {}
template < typename Other >
// 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>>;
case ref_types::const_rvalue:
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() ) {
@@ -230,9 +229,8 @@ namespace meta_hpp::detail
return std::is_constructible_v<To, to_raw_type&&> && can_cast_to<to_raw_type&&>();
case ref_types::const_rvalue:
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() ) {

View File

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

View File

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

View File

@@ -23,7 +23,17 @@ target_compile_options(${PROJECT_NAME}
-Werror -Wall -Wextra -Wpedantic>
PRIVATE
$<$<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
DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS

View File

@@ -23,7 +23,18 @@ target_compile_options(${PROJECT_NAME}
-Werror -Wall -Wextra -Wpedantic>
PRIVATE
$<$<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
DOCTEST_CONFIG_INCLUDE_TYPE_TRAITS

View File

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

View File

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

View File

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

View File

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

View File

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