From 83fd973f55cb892dea0e27d3e339a14926e4dfad Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Fri, 1 Jul 2022 22:47:50 +0700 Subject: [PATCH] remove interface warning tuning --- .clang-tidy | 2 ++ CMakeLists.txt | 21 ------------------- headers/meta.hpp/meta_base/enum.hpp | 4 ++-- .../meta_detail/value_utilities/uarg.hpp | 6 ++---- .../meta_detail/value_utilities/uinst.hpp | 3 +-- headers/meta.hpp/meta_types.hpp | 6 +++--- manuals/CMakeLists.txt | 12 ++++++++++- untests/CMakeLists.txt | 13 +++++++++++- untests/meta_states/ctor_tests.cpp | 4 ++-- untests/meta_states/metadata_tests.cpp | 4 ++-- untests/meta_utilities/hash_tests.cpp | 4 ++-- untests/meta_utilities/value2_tests.cpp | 8 +++---- untests/meta_utilities/value_tests.cpp | 8 +++---- 13 files changed, 47 insertions(+), 48 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 80ca7c8..10d9d4c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -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, ' diff --git a/CMakeLists.txt b/CMakeLists.txt index 4724086..cadd0c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - $<$: - > - INTERFACE - $<$: - > - INTERFACE - $<$,$>: - -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 # diff --git a/headers/meta.hpp/meta_base/enum.hpp b/headers/meta.hpp/meta_base/enum.hpp index 6cbe035..c727326 100644 --- a/headers/meta.hpp/meta_base/enum.hpp +++ b/headers/meta.hpp/meta_base/enum.hpp @@ -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) diff --git a/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp b/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp index d248dea..4b9d583 100644 --- a/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp +++ b/headers/meta.hpp/meta_detail/value_utilities/uarg.hpp @@ -209,9 +209,8 @@ namespace meta_hpp::detail return std::is_convertible_v>; case ref_types::const_rvalue: return std::is_convertible_v>; - 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 && can_cast_to(); case ref_types::const_rvalue: return std::is_constructible_v && can_cast_to(); - default: - return false; } + return false; }; if ( is_a(to_type, from_type) && is_constructible() ) { diff --git a/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp b/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp index b2c30a7..d613ada 100644 --- a/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp +++ b/headers/meta.hpp/meta_detail/value_utilities/uinst.hpp @@ -163,9 +163,8 @@ namespace meta_hpp::detail return std::is_invocable_v; case ref_types::const_rvalue: return std::is_invocable_v; - default: - return false; } + return false; }; return is_a(to_type, from_type) && is_invocable(); diff --git a/headers/meta.hpp/meta_types.hpp b/headers/meta.hpp/meta_types.hpp index 2a60abf..e177f44 100644 --- a/headers/meta.hpp/meta_types.hpp +++ b/headers/meta.hpp/meta_types.hpp @@ -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 { diff --git a/manuals/CMakeLists.txt b/manuals/CMakeLists.txt index 19cb03b..28a3ba3 100644 --- a/manuals/CMakeLists.txt +++ b/manuals/CMakeLists.txt @@ -23,7 +23,17 @@ target_compile_options(${PROJECT_NAME} -Werror -Wall -Wextra -Wpedantic> PRIVATE $<$,$>: - -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 diff --git a/untests/CMakeLists.txt b/untests/CMakeLists.txt index b9115fc..a60bcbb 100644 --- a/untests/CMakeLists.txt +++ b/untests/CMakeLists.txt @@ -23,7 +23,18 @@ target_compile_options(${PROJECT_NAME} -Werror -Wall -Wextra -Wpedantic> PRIVATE $<$,$>: - -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 diff --git a/untests/meta_states/ctor_tests.cpp b/untests/meta_states/ctor_tests.cpp index cac2e2d..aabfae6 100644 --- a/untests/meta_states/ctor_tests.cpp +++ b/untests/meta_states/ctor_tests.cpp @@ -12,8 +12,8 @@ namespace struct clazz { int i{}; - clazz(int i) - : i{i} { + clazz(int ni) + : i{ni} { ++constructor_counter; } diff --git a/untests/meta_states/metadata_tests.cpp b/untests/meta_states/metadata_tests.cpp index ec13c0c..2cf0c7f 100644 --- a/untests/meta_states/metadata_tests.cpp +++ b/untests/meta_states/metadata_tests.cpp @@ -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; diff --git a/untests/meta_utilities/hash_tests.cpp b/untests/meta_utilities/hash_tests.cpp index 085f2a9..2b38142 100644 --- a/untests/meta_utilities/hash_tests.cpp +++ b/untests/meta_utilities/hash_tests.cpp @@ -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; diff --git a/untests/meta_utilities/value2_tests.cpp b/untests/meta_utilities/value2_tests.cpp index b91c240..11f303d 100644 --- a/untests/meta_utilities/value2_tests.cpp +++ b/untests/meta_utilities/value2_tests.cpp @@ -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} diff --git a/untests/meta_utilities/value_tests.cpp b/untests/meta_utilities/value_tests.cpp index 0fb4f7d..08450f4 100644 --- a/untests/meta_utilities/value_tests.cpp +++ b/untests/meta_utilities/value_tests.cpp @@ -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};