From 3ace10a1991b08c7a7dd6931de48044e7ae073c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 10:55:20 +0200 Subject: [PATCH 01/10] windows ci-workflows --- .github/workflows/cmake.yml | 10 ++++ CMakePresets.json | 102 +++++++++++++++++++++++++++++++++++- cmake/CPM.cmake | 4 +- 3 files changed, 113 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 4fa78a0..c333132 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -43,3 +43,13 @@ jobs: run: cmake --workflow --preset="ci-clang-18-release" - name: clang-18-libc++-release run: cmake --workflow --preset="ci-clang-18-libc++-release" + + build-and-test-msvc: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: ci-clangcl-release + run: cmake --workflow --preset="ci-clangcl-release" + - name: ci-msvc-release + run: cmake --workflow --preset="ci-msvc-release" + diff --git a/CMakePresets.json b/CMakePresets.json index 2874e69..1008661 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -61,9 +61,25 @@ "generator": "Visual Studio 17 2022", "toolset": "ClangCL" }, + { + "name": "ci-windows-base", + "hidden": true, + "inherits": ["cfg-common", "cfg-c++23", "cfg-build-dir"], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "ci-clangcl-release", + "inherits": ["ci-windows-base"], + "generator": "Visual Studio 17 2022", + "toolset": "ClangCL" + }, { "name": "ci-msvc-release", - "inherits": ["cfg-common", "cfg-build-dir"], + "inherits": ["ci-windows-base"], "generator": "Visual Studio 17 2022" } ], @@ -79,6 +95,24 @@ { "name": "ci-gcc-14-release", "configurePreset": "ci-gcc-14-release" + }, + { + "name": "ci-clangcl-release", + "configurePreset": "ci-clangcl-release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "ci-msvc-release", + "configurePreset": "ci-msvc-release", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } } ], "testPresets": [ @@ -99,6 +133,28 @@ "configurePreset": "ci-gcc-14-release", "output": {"outputOnFailure": true}, "execution": {"noTestsAction": "error", "stopOnFailure": true} + }, + { + "name": "ci-clangcl-release", + "configurePreset": "ci-clangcl-release", + "output": {"outputOnFailure": true}, + "execution": {"noTestsAction": "error", "stopOnFailure": true}, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "ci-msvc-release", + "configurePreset": "ci-msvc-release", + "output": {"outputOnFailure": true}, + "execution": {"noTestsAction": "error", "stopOnFailure": true}, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } } ], "workflowPresets": [ @@ -152,6 +208,50 @@ "name": "ci-gcc-14-release" } ] + }, + { + "name": "ci-clangcl-release", + "steps": [ + { + "type": "configure", + "name": "ci-clangcl-release" + }, + { + "type": "build", + "name": "ci-clangcl-release" + }, + { + "type": "test", + "name": "ci-clangcl-release" + } + ], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "ci-msvc-release", + "steps": [ + { + "type": "configure", + "name": "ci-msvc-release" + }, + { + "type": "build", + "name": "ci-msvc-release" + }, + { + "type": "test", + "name": "ci-msvc-release" + } + ], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } } ] } diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index f2c1205..baf2d8c 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -2,8 +2,8 @@ # # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors -set(CPM_DOWNLOAD_VERSION 0.40.0) -set(CPM_HASH_SUM "7b354f3a5976c4626c876850c93944e52c83ec59a159ae5de5be7983f0e17a2a") +set(CPM_DOWNLOAD_VERSION 0.40.2) +set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d") if(CPM_SOURCE_CACHE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") From 1772a018a55865fb81e48f8f203d50cd7d2c045e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 10:57:17 +0200 Subject: [PATCH 02/10] update --- CMakePresets.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1008661..2e9f4d1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -224,12 +224,7 @@ "type": "test", "name": "ci-clangcl-release" } - ], - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } + ] }, { "name": "ci-msvc-release", @@ -246,12 +241,7 @@ "type": "test", "name": "ci-msvc-release" } - ], - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } + ] } ] } From 8d0630db19666717fe2d31d899833f14403743fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 10:59:52 +0200 Subject: [PATCH 03/10] update --- CMakePresets.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 2e9f4d1..c868161 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -55,12 +55,6 @@ "inherits": [ "cfg-common", "cfg-build-dir", "cfg-ninja", "cfg-c++23" ], "cacheVariables": {"CMAKE_CXX_COMPILER": "g++-14" } }, - { - "name": "ci-clangcl-release", - "inherits": ["cfg-common", "cfg-build-dir"], - "generator": "Visual Studio 17 2022", - "toolset": "ClangCL" - }, { "name": "ci-windows-base", "hidden": true, From 4ea3e2a98637e47b03c399876c9342ad76125fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 11:09:40 +0200 Subject: [PATCH 04/10] update --- unit_tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 81e08b0..f0f9c65 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -18,7 +18,8 @@ target_link_libraries( fixedmath_ut_core ) target_include_directories( fixedmath_ut_core INTERFACE include ) -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") +if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + AND NOT (WIN32 AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")) target_compile_options(fixedmath_ut_core INTERFACE -Wno-disabled-macro-expansion From 6f9eaf404e3a1442c531bfc39e78ff4d9fdabe1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 11:44:23 +0200 Subject: [PATCH 05/10] clang-cl fixes --- unit_tests/addition_ut.cc | 1 - unit_tests/multiplication_ut.cc | 1 - unit_tests/sqrt_ut.cc | 15 +++++++-------- unit_tests/subtraction_ut.cc | 1 - 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/unit_tests/addition_ut.cc b/unit_tests/addition_ut.cc index d2c1c7b..052ca97 100644 --- a/unit_tests/addition_ut.cc +++ b/unit_tests/addition_ut.cc @@ -8,7 +8,6 @@ using namespace fixedmath; int main() { test_result result; - using F = fixedmath::fixed_internal; "addition"_test = [&result] { auto fn_tmpl = [] -> metatests::test_result diff --git a/unit_tests/multiplication_ut.cc b/unit_tests/multiplication_ut.cc index 3c8db57..e7f3637 100644 --- a/unit_tests/multiplication_ut.cc +++ b/unit_tests/multiplication_ut.cc @@ -9,7 +9,6 @@ using namespace fixedmath::func; int main() { test_result result; - using F = fixedmath::fixed_internal; "multiplication"_test = [&result] { auto fn_tmpl = [] -> metatests::test_result diff --git a/unit_tests/sqrt_ut.cc b/unit_tests/sqrt_ut.cc index 8083b61..cb177c9 100644 --- a/unit_tests/sqrt_ut.cc +++ b/unit_tests/sqrt_ut.cc @@ -25,7 +25,6 @@ constexpr auto asfix(T const v) int main() { test_result result; - using F = fixedmath::fixed_internal; "sqrt"_test = [&result] { auto fn_tmpl = [] -> metatests::test_result @@ -56,13 +55,13 @@ int main() test_hypot(14.9916076660156250_fix, 0_fix, 14.99160_fix, 0.0001_fix); test_hypot(0_fix, 14.9916076660156250_fix, 14.99160_fix, 0.0001_fix); - test_hypot(asfix(1ul << 30), asfix(1u << 0), 16384_fix, 0.0001_fix); - test_hypot(asfix(1ul << 33), asfix(1ul << 31), 135104_fix, 0.0001_fix); - test_hypot(asfix(1ul << 32), asfix(1ul << 31), 73271_fix, 1.1_fix); - test_hypot(asfix(1ul << 31), asfix(1ul << 31), 46340_fix, 1.1_fix); - test_hypot(asfix(1ul << 32), asfix(1ul), 65536_fix, 0.0001_fix); - test_hypot(asfix(1ul << 30), asfix(1u << 30), 23170_fix, 1_fix); - test_hypot(asfix((1ul << 30) - 1), asfix((1ul << 30) - 1), 23170.47497_fix, 0.0001_fix); + test_hypot(asfix(1ull << 30), asfix(1u << 0), 16384_fix, 0.0001_fix); + test_hypot(asfix(1ull << 33), asfix(1ul << 31), 135104_fix, 0.0001_fix); + test_hypot(asfix(1ull << 32), asfix(1ul << 31), 73271_fix, 1.1_fix); + test_hypot(asfix(1ull << 31), asfix(1ul << 31), 46340_fix, 1.1_fix); + test_hypot(asfix(1ull << 32), asfix(1ul), 65536_fix, 0.0001_fix); + test_hypot(asfix(1ull << 30), asfix(1u << 30), 23170_fix, 1_fix); + test_hypot(asfix((1ull << 30) - 1), asfix((1ul << 30) - 1), 23170.47497_fix, 0.0001_fix); test_hypot(asfix(1u), asfix(1u), 0.000015_fix, 0.00001_fix); test_hypot(asfix(2u), asfix(2u), 0.000030_fix, 0.00001_fix); diff --git a/unit_tests/subtraction_ut.cc b/unit_tests/subtraction_ut.cc index 37d603b..dcb7cc7 100644 --- a/unit_tests/subtraction_ut.cc +++ b/unit_tests/subtraction_ut.cc @@ -8,7 +8,6 @@ using namespace fixedmath; int main() { test_result result; - using F = fixedmath::fixed_internal; "addition"_test = [&result] { auto fn_tmpl = [] -> metatests::test_result From 59a007957659a45a9c891efa83f07aa32dea9a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 11:55:07 +0200 Subject: [PATCH 06/10] update --- fixed_lib/include/fixedmath/core_ops.h | 3 +++ .../detail/static_call_operator_epilog.h | 8 +++++++ .../detail/static_call_operator_prolog.h | 23 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h create mode 100644 fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h diff --git a/fixed_lib/include/fixedmath/core_ops.h b/fixed_lib/include/fixedmath/core_ops.h index 4194f96..99241db 100644 --- a/fixed_lib/include/fixedmath/core_ops.h +++ b/fixed_lib/include/fixedmath/core_ops.h @@ -9,6 +9,8 @@ #include "numbers.h" #include "detail/common.h" +#include "detail/static_call_operator_prolog.h + namespace fixedmath::inline v2 { //------------------------------------------------------------------------------------------------------ @@ -105,3 +107,4 @@ constexpr fixed_t::operator arithmethic_type() const noexcept } // namespace fixedmath::inline v2 +#include "detail/static_call_operator_epilog.h" \ No newline at end of file diff --git a/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h b/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h new file mode 100644 index 0000000..f1bc352 --- /dev/null +++ b/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h @@ -0,0 +1,8 @@ +#ifndef STATIC_CALL_OPERATOR_INCLUDED +#error "check inclusion of static_call_operator" +#endif +#undef STATIC_CALL_OPERATOR_INCLUDED + +#pragma pop_macro("static_call_operator_const") +#pragma pop_macro("static_call_operator") +#pragma pop_macro("static_constexpr") diff --git a/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h b/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h new file mode 100644 index 0000000..a072cea --- /dev/null +++ b/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h @@ -0,0 +1,23 @@ +#ifdef STATIC_CALL_OPERATOR_INCLUDED +#error "Multiple inclusion of static_call_operator" +#endif +#define STATIC_CALL_OPERATOR_INCLUDED + +#pragma push_macro("static_constexpr") +#pragma push_macro("static_call_operator") +#pragma push_macro("static_call_operator_const") + +#if __cplusplus > 202002L +#define static_constexpr static +#else +#define static_constexpr +#endif + +#if __cplusplus >= 202301L && defined(__cpp_static_call_operator) +#define static_call_operator static +#define static_call_operator_const +#else +#define static_call_operator +#define static_call_operator_const const +#endif + From 457470c9b7a460f511a7a73b56fbb4e28873e968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 12:11:28 +0200 Subject: [PATCH 07/10] update --- fixed_lib/include/fixedmath/core_ops.h | 9 ++- .../detail/static_call_operator_epilog.h | 2 +- .../detail/static_call_operator_prolog.h | 6 -- .../include/fixedmath/detail/type_traits.h | 1 - .../include/fixedmath/detail/utility_cxx20.h | 41 ---------- fixed_lib/include/fixedmath/math.h | 79 +++++++++++++------ fixed_lib/include/fixedmath/types.h | 6 +- 7 files changed, 64 insertions(+), 80 deletions(-) delete mode 100644 fixed_lib/include/fixedmath/detail/utility_cxx20.h diff --git a/fixed_lib/include/fixedmath/core_ops.h b/fixed_lib/include/fixedmath/core_ops.h index 99241db..21cbfa8 100644 --- a/fixed_lib/include/fixedmath/core_ops.h +++ b/fixed_lib/include/fixedmath/core_ops.h @@ -9,7 +9,7 @@ #include "numbers.h" #include "detail/common.h" -#include "detail/static_call_operator_prolog.h +#include "detail/static_call_operator_prolog.h" namespace fixedmath::inline v2 { @@ -27,7 +27,7 @@ struct arithmetic_to_fixed_t template [[nodiscard, gnu::const, gnu::always_inline]] ///\returns fixed on success or NaN if source value is out of range - static constexpr auto operator()(arithmetic_type value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(arithmetic_type value) static_call_operator_const noexcept -> fixed_t { if constexpr(std::is_integral_v) { @@ -76,7 +76,8 @@ template struct fixed_to_arithmetic_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto value) noexcept -> arithmethic_type + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> arithmethic_type { if constexpr(typetraits::is_integral_v) { @@ -107,4 +108,4 @@ constexpr fixed_t::operator arithmethic_type() const noexcept } // namespace fixedmath::inline v2 -#include "detail/static_call_operator_epilog.h" \ No newline at end of file +#include "detail/static_call_operator_epilog.h" diff --git a/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h b/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h index f1bc352..0643a71 100644 --- a/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h +++ b/fixed_lib/include/fixedmath/detail/static_call_operator_epilog.h @@ -5,4 +5,4 @@ #pragma pop_macro("static_call_operator_const") #pragma pop_macro("static_call_operator") -#pragma pop_macro("static_constexpr") + diff --git a/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h b/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h index a072cea..7c7d510 100644 --- a/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h +++ b/fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h @@ -7,12 +7,6 @@ #pragma push_macro("static_call_operator") #pragma push_macro("static_call_operator_const") -#if __cplusplus > 202002L -#define static_constexpr static -#else -#define static_constexpr -#endif - #if __cplusplus >= 202301L && defined(__cpp_static_call_operator) #define static_call_operator static #define static_call_operator_const diff --git a/fixed_lib/include/fixedmath/detail/type_traits.h b/fixed_lib/include/fixedmath/detail/type_traits.h index 4777ba0..9696475 100644 --- a/fixed_lib/include/fixedmath/detail/type_traits.h +++ b/fixed_lib/include/fixedmath/detail/type_traits.h @@ -9,7 +9,6 @@ #include #include #include -#include "utility_cxx20.h" namespace fixedmath::inline v2 { diff --git a/fixed_lib/include/fixedmath/detail/utility_cxx20.h b/fixed_lib/include/fixedmath/detail/utility_cxx20.h deleted file mode 100644 index ba2c332..0000000 --- a/fixed_lib/include/fixedmath/detail/utility_cxx20.h +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-FileCopyrightText: 2020-2024 Artur Bać -// SPDX-License-Identifier: BSL-1.0 -// SPDX-PackageHomePage: https://github.com/arturbac/fixed_math - -#pragma once - -#if !defined(SMALL_VECTORS_CXX_UTILITY) -#define SMALL_VECTORS_CXX_UTILITY 1 - -#include -#include -#include -#include -#include -#include -#include - -namespace cxx20 - { - -using std::assume_aligned; -using std::bit_cast; -using std::byteswap; -using std::countl_zero; -using std::countr_zero; - } // namespace cxx20 - -namespace cxx23 - { -#if defined(__cpp_lib_to_underlying) -using std::to_underlying; -#else -template -constexpr std::underlying_type_t to_underlying(T value) noexcept - { - return static_cast>(value); - } -#endif - } // namespace cxx23 -#endif // SMALL_VECTORS_CXX_UTILITY - diff --git a/fixed_lib/include/fixedmath/math.h b/fixed_lib/include/fixedmath/math.h index c95b84d..7b13d33 100644 --- a/fixed_lib/include/fixedmath/math.h +++ b/fixed_lib/include/fixedmath/math.h @@ -8,6 +8,8 @@ #include "core_ops.h" #include +#include "detail/static_call_operator_prolog.h" + namespace fixedmath::inline v2::detail { @@ -43,7 +45,8 @@ namespace detail struct abs_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> fixed_t { // cmp x0, #0 // =0 // cneg x0, x0, mi @@ -58,7 +61,8 @@ inline constexpr abs_t abs; struct isnan_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto value) noexcept -> bool + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> bool { return abs(value) == quiet_NaN_result(); } @@ -71,7 +75,8 @@ inline constexpr isnan_t isnan; struct rshift_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto l, int r) noexcept -> fixed_t + static_call_operator constexpr auto + operator()(std::same_as auto l, int r) static_call_operator_const noexcept -> fixed_t { if(r >= 0) [[likely]] return fix_carrier_t{l.v >> r}; @@ -86,7 +91,8 @@ inline constexpr rshift_t rshift; struct lshift_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto l, int r) noexcept -> fixed_t + static_call_operator constexpr auto + operator()(std::same_as auto l, int r) static_call_operator_const noexcept -> fixed_t { using unsigned_fix_internal = std::make_unsigned::type; @@ -107,7 +113,8 @@ inline constexpr lshift_t lshift; struct bit_and_t { [[nodiscard, gnu::const, gnu::always_inline]] - inline auto constexpr operator()(std::same_as auto l, std::same_as auto r) noexcept -> fixed_t + static_call_operator inline constexpr auto operator()(std::same_as auto l, std::same_as auto r) + static_call_operator_const noexcept -> fixed_t { return fix_carrier_t{l.v & r.v}; } @@ -146,7 +153,8 @@ struct add_t template requires concepts::arithmetic_and_one_is_fixed [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(supported_type1 lh, supported_type2 rh) noexcept + static_call_operator constexpr auto + operator()(supported_type1 lh, supported_type2 rh) static_call_operator_const noexcept { if constexpr(typetraits::one_of_is_double_v) return detail::promote_to_double(rh) + detail::promote_to_double(lh); @@ -189,7 +197,8 @@ struct subtract_t template requires concepts::arithmetic_and_one_is_fixed [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(supported_type1 lh, supported_type2 rh) noexcept + static_call_operator constexpr auto + operator()(supported_type1 lh, supported_type2 rh) static_call_operator_const noexcept { if constexpr(typetraits::one_of_is_double_v) return detail::promote_to_double(lh) - detail::promote_to_double(rh); @@ -248,7 +257,8 @@ struct multiply_t template requires concepts::arithmetic_and_one_is_fixed [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(supported_type1 lh, supported_type2 rh) noexcept + static_call_operator constexpr auto + operator()(supported_type1 lh, supported_type2 rh) static_call_operator_const noexcept { if constexpr(typetraits::one_of_is_double_v) return detail::promote_to_double(lh) * detail::promote_to_double(rh); @@ -299,7 +309,8 @@ struct division_t template requires concepts::arithmetic_and_one_is_fixed [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(supported_type1 lh, supported_type2 rh) noexcept + static_call_operator constexpr auto + operator()(supported_type1 lh, supported_type2 rh) static_call_operator_const noexcept { if constexpr(std::is_integral_v) return detail::fixed_division_by_scalar(lh, rh); @@ -317,7 +328,8 @@ inline constexpr division_t division; struct ceil_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> fixed_t { fixed_internal result{(value.v + 0xffff) & ~((1 << 16ll) - 1)}; if(value.v < result) @@ -333,7 +345,8 @@ inline constexpr ceil_t ceil; struct floor_t { [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(std::same_as auto value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> fixed_t { value = as_fixed(value.v & ~((1 << 16) - 1)); return value; @@ -350,7 +363,7 @@ struct angle_to_radians_t template requires(sizeof(integral_type) > 1) [[nodiscard, gnu::const, gnu::always_inline]] - static constexpr auto operator()(integral_type angle) noexcept -> fixed_t + static_call_operator constexpr auto operator()(integral_type angle) static_call_operator_const noexcept -> fixed_t { if(angle >= integral_type(0) && angle <= integral_type(360)) return division(multiply(arithmetic_to_fixed(angle), fixedmath::phi), 180); @@ -395,7 +408,8 @@ inline constexpr bool sqrt_constexpr_available = true; struct sqrt_t { [[nodiscard]] - static constexpr auto operator()(std::same_as auto value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> fixed_t { if(std::is_constant_evaluated()) return detail::sqrt_abacus(value); @@ -411,7 +425,8 @@ inline constexpr sqrt_t sqrt; struct hypot_t { [[nodiscard]] - static constexpr auto operator()(std::same_as auto lh, std::same_as auto rh) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto lh, std::same_as auto rh) + static_call_operator_const noexcept -> fixed_t { constexpr int prec_ = 16; // sqrt(X^2+Y^2) = sqrt( (X/D)^2+(Y/D)^2) * D @@ -432,7 +447,7 @@ struct hypot_t // check hi for overflow and shift right with d else if(uhi >= (1ull << 30)) { - int rshbits{48 - cxx20::countl_zero(uhi)}; + int rshbits{48 - std::countl_zero(uhi)}; uhi >>= rshbits; ulo >>= rshbits; return as_fixed(sqrt(as_fixed(fixed_internal(uhi * uhi + ulo * ulo) >> prec_)).v << rshbits); @@ -440,7 +455,7 @@ struct hypot_t // else check lo for underflow and shift left with d else if(ulo < (1 << 16)) { - int lshbits{std::max(cxx20::countl_zero(uhi) - 30, 0) >> 1}; + int lshbits{std::max(std::countl_zero(uhi) - 30, 0) >> 1}; uhi <<= lshbits; ulo <<= lshbits; return as_fixed(sqrt(as_fixed(fixed_internal(uhi * uhi + ulo * ulo) >> prec_)).v >> lshbits); @@ -484,7 +499,8 @@ struct sin_t /// /// error is less or equal to X^9/9! [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto rad) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto rad + ) static_call_operator_const noexcept -> fixed_t { using detail::mul_; rad = detail::sin_range(rad); @@ -533,7 +549,8 @@ struct cos_t { ///\returns cosine of value in radians [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto rad) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto rad + ) static_call_operator_const noexcept -> fixed_t { // more effective to use sine than calculate maclurin series for cosine // as maclurin series give precise results for -pi/2 .. pi/2 @@ -630,7 +647,8 @@ namespace detail struct tan_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto rad) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto rad + ) static_call_operator_const noexcept -> fixed_t { using detail::div_; using detail::tan_; @@ -707,7 +725,8 @@ namespace detail struct atan_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto value) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto value + ) static_call_operator_const noexcept -> fixed_t { using detail::atan; using detail::atan_sum; @@ -759,7 +778,8 @@ inline constexpr atan_t atan; struct atan2_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto y, std::same_as auto x) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto y, std::same_as auto x) + static_call_operator_const noexcept -> fixed_t { if(x > 0_fix) return atan(y / x); @@ -821,7 +841,8 @@ namespace detail struct asin_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto x) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto x + ) static_call_operator_const noexcept -> fixed_t { using detail::asin; using detail::set_sign; @@ -864,7 +885,8 @@ inline constexpr asin_t asin; struct acos_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(std::same_as auto x) noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto x + ) static_call_operator_const noexcept -> fixed_t { if(x >= -1_fix && x <= 1_fix) [[likely]] return as_fixed(fixpidiv2.v - asin(x).v); @@ -879,7 +901,8 @@ inline constexpr acos_t acos; struct sin_angle_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(concepts::arithmetic auto angle) noexcept -> fixed_t + static_call_operator constexpr auto operator()(concepts::arithmetic auto angle + ) static_call_operator_const noexcept -> fixed_t { return sin(division(multiply(angle, phi), 180)); } @@ -891,7 +914,8 @@ inline constexpr sin_angle_t sin_angle; struct cos_angle_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(concepts::arithmetic auto angle) noexcept -> fixed_t + static_call_operator constexpr auto operator()(concepts::arithmetic auto angle + ) static_call_operator_const noexcept -> fixed_t { return cos(division(multiply(angle, phi), 180)); } @@ -903,7 +927,8 @@ inline cos_angle_t cos_angle; struct tan_angle_t { [[nodiscard, gnu::const]] - static constexpr auto operator()(concepts::arithmetic auto angle) noexcept -> fixed_t + static_call_operator constexpr auto operator()(concepts::arithmetic auto angle + ) static_call_operator_const noexcept -> fixed_t { return tan(division(multiply(angle, phi), 180)); } @@ -912,3 +937,5 @@ struct tan_angle_t inline constexpr tan_angle_t tan_angle; } // namespace fixedmath::inline v2::fobj + +#include "detail/static_call_operator_epilog.h" diff --git a/fixed_lib/include/fixedmath/types.h b/fixed_lib/include/fixedmath/types.h index 9ad1443..87b5127 100644 --- a/fixed_lib/include/fixedmath/types.h +++ b/fixed_lib/include/fixedmath/types.h @@ -6,6 +6,8 @@ #include "detail/type_traits.h" +#include "detail/static_call_operator_prolog.h" + #define FIXEDMATH_VERSION_MAJOR 2 #define FIXEDMATH_VERSION_MINOR 0 #define FIXEDMATH_VERSION_PATCH 0 @@ -41,7 +43,8 @@ struct fixed_t struct as_fixed_t { - constexpr auto operator()(std::same_as auto carried) const noexcept -> fixed_t + static_call_operator constexpr auto operator()(std::same_as auto carried + ) static_call_operator_const noexcept -> fixed_t { return fix_carrier_t{carried}; } @@ -64,3 +67,4 @@ constexpr auto operator<=>(std::same_as auto l, std::same_as a } // namespace fixedmath::inline v2 +#include "detail/static_call_operator_epilog.h" From 1ad7649a08d40444f3609b16f69dbf5b3acaf09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 12:21:01 +0200 Subject: [PATCH 08/10] update --- CMakePresets.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index c868161..0984770 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -93,6 +93,7 @@ { "name": "ci-clangcl-release", "configurePreset": "ci-clangcl-release", + "configuration": "Release", "condition": { "type": "equals", "lhs": "${hostSystemName}", @@ -102,6 +103,7 @@ { "name": "ci-msvc-release", "configurePreset": "ci-msvc-release", + "configuration": "Release", "condition": { "type": "equals", "lhs": "${hostSystemName}", @@ -131,6 +133,7 @@ { "name": "ci-clangcl-release", "configurePreset": "ci-clangcl-release", + "configuration": "Release", "output": {"outputOnFailure": true}, "execution": {"noTestsAction": "error", "stopOnFailure": true}, "condition": { @@ -142,6 +145,7 @@ { "name": "ci-msvc-release", "configurePreset": "ci-msvc-release", + "configuration": "Release", "output": {"outputOnFailure": true}, "execution": {"noTestsAction": "error", "stopOnFailure": true}, "condition": { From 27a16e1819b6f82e0256391c36b3eb8e785e2551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 12:42:05 +0200 Subject: [PATCH 09/10] msvc downgrade fixes --- fixed_lib/include/fixedmath/detail/common.h | 1 + unit_tests/addition_ut.cc | 2 +- unit_tests/atan_ut.cc | 4 ++-- unit_tests/division_ut.cc | 2 +- unit_tests/fixed_construction_ut.cc | 2 +- unit_tests/misc_functions_ut.cc | 6 +++--- unit_tests/multiplication_ut.cc | 2 +- unit_tests/sin_cos_ut.cc | 4 ++-- unit_tests/sqrt_ut.cc | 4 ++-- unit_tests/subtraction_ut.cc | 2 +- unit_tests/tan_ut.cc | 2 +- unit_tests/type_convertions_ut.cc | 8 ++++---- 12 files changed, 20 insertions(+), 19 deletions(-) diff --git a/fixed_lib/include/fixedmath/detail/common.h b/fixed_lib/include/fixedmath/detail/common.h index 638fe95..309aacb 100644 --- a/fixed_lib/include/fixedmath/detail/common.h +++ b/fixed_lib/include/fixedmath/detail/common.h @@ -6,6 +6,7 @@ #include "../types.h" #include +#include namespace fixedmath::inline v2::detail { diff --git a/unit_tests/addition_ut.cc b/unit_tests/addition_ut.cc index 052ca97..9b9c48b 100644 --- a/unit_tests/addition_ut.cc +++ b/unit_tests/addition_ut.cc @@ -10,7 +10,7 @@ int main() test_result result; "addition"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(fobj::add(0_fix, 1_fix), 1_fix); expect_eq(fobj::add(1_fix, 1_fix), 2_fix); diff --git a/unit_tests/atan_ut.cc b/unit_tests/atan_ut.cc index efca937..76ba58d 100644 --- a/unit_tests/atan_ut.cc +++ b/unit_tests/atan_ut.cc @@ -27,7 +27,7 @@ int main() test_result result; "atan"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_atan(1_fix / 16, 0.062418_fix, 0.000025_fix); test_atan(3_fix / 16, 0.185347_fix, 0.000025_fix); @@ -55,7 +55,7 @@ int main() "atan2"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_atan2(-1 / 2_fix, -1 / 2_fix, -2.3561944901923448_fix, 0.00005_fix); diff --git a/unit_tests/division_ut.cc b/unit_tests/division_ut.cc index 904c0c1..da30430 100644 --- a/unit_tests/division_ut.cc +++ b/unit_tests/division_ut.cc @@ -12,7 +12,7 @@ int main() "division"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(1_fix / 1_fix, 1_fix); expect_eq(-1_fix / 1_fix, -1_fix); diff --git a/unit_tests/fixed_construction_ut.cc b/unit_tests/fixed_construction_ut.cc index e38af90..cc4d35f 100644 --- a/unit_tests/fixed_construction_ut.cc +++ b/unit_tests/fixed_construction_ut.cc @@ -101,7 +101,7 @@ int main() test_result result; "fixed construction"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(fixed_t{1}, 1_fix); expect_eq(fixed_t{1u}, 1_fix); diff --git a/unit_tests/misc_functions_ut.cc b/unit_tests/misc_functions_ut.cc index 480776c..222bd02 100644 --- a/unit_tests/misc_functions_ut.cc +++ b/unit_tests/misc_functions_ut.cc @@ -12,7 +12,7 @@ int main() "ceil"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(ceil(-0.25_fix), 0_fix); expect_eq(ceil(-1.25_fix), -1_fix); @@ -30,7 +30,7 @@ int main() "floor"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(fixed_to_arithmetic(floor(0.25_fix)), 0); expect_eq(floor(-1_fix + limits_::epsilon()), -1_fix); // @@ -49,7 +49,7 @@ int main() "angle_to_radians"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(angle_to_radians(0), 0_fix); expect_eq(angle_to_radians(180), 3.1415926536_fix); diff --git a/unit_tests/multiplication_ut.cc b/unit_tests/multiplication_ut.cc index e7f3637..10327b9 100644 --- a/unit_tests/multiplication_ut.cc +++ b/unit_tests/multiplication_ut.cc @@ -11,7 +11,7 @@ int main() test_result result; "multiplication"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(1_fix * 1_fix, 1_fix); expect_eq(10_fix * 0.5_fix, 5_fix); diff --git a/unit_tests/sin_cos_ut.cc b/unit_tests/sin_cos_ut.cc index 07a47fc..0d5ad7a 100644 --- a/unit_tests/sin_cos_ut.cc +++ b/unit_tests/sin_cos_ut.cc @@ -29,7 +29,7 @@ int main() test_result result; "sin"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_sin(phi + phi / 2, -0.99986_fix, 0.0001_fix); test_sin(phi + phi / 4, -0.7071_fix, 0.0001_fix); @@ -77,7 +77,7 @@ int main() "cos"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_cos(2 * phi, 0.9998_fix, 0.0001_fix); test_cos(phi, -0.9998_fix, 0.0001_fix); diff --git a/unit_tests/sqrt_ut.cc b/unit_tests/sqrt_ut.cc index cb177c9..de41975 100644 --- a/unit_tests/sqrt_ut.cc +++ b/unit_tests/sqrt_ut.cc @@ -27,7 +27,7 @@ int main() test_result result; "sqrt"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_approx(sqrt(1.4111175537109375_fix), 1.1878_fix, 0.001_fix); expect_approx(sqrt(2.0000000000000000_fix), 1.4141_fix, 0.001_fix); @@ -46,7 +46,7 @@ int main() "hypot"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_hypot(-14.991608_fix, -0.837158_fix, 15.01495_fix, 0.0001_fix); test_hypot(-14.991608_fix, -0.837158_fix, 15.01495_fix, 0.0001_fix); diff --git a/unit_tests/subtraction_ut.cc b/unit_tests/subtraction_ut.cc index dcb7cc7..b049b41 100644 --- a/unit_tests/subtraction_ut.cc +++ b/unit_tests/subtraction_ut.cc @@ -10,7 +10,7 @@ int main() test_result result; "addition"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(0.2_fix - 1.2_fix, -1_fix); expect_eq(3.2_fix - 1.2_fix, 2_fix); diff --git a/unit_tests/tan_ut.cc b/unit_tests/tan_ut.cc index a1f8538..ed89ec3 100644 --- a/unit_tests/tan_ut.cc +++ b/unit_tests/tan_ut.cc @@ -18,7 +18,7 @@ int main() test_result result; "tan"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { test_tan(phi / 2 + phi / 32, -10.155854941143394_fix, 0.0001_fix); test_tan(phi / 3, 1.73204_fix, 0.0001_fix); diff --git a/unit_tests/type_convertions_ut.cc b/unit_tests/type_convertions_ut.cc index 9e641f0..6be1bb3 100644 --- a/unit_tests/type_convertions_ut.cc +++ b/unit_tests/type_convertions_ut.cc @@ -12,7 +12,7 @@ int main() "arithmetic_to_fixed integrals"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(arithmetic_to_fixed(0), 0_fix); expect_eq(arithmetic_to_fixed(1), limits_::one()); @@ -39,7 +39,7 @@ int main() "arithmetic_to_fixed floating point"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(arithmetic_to_fixed(0.f), 0_fix); expect_eq(arithmetic_to_fixed(-1.f), -limits_::one()); @@ -79,7 +79,7 @@ int main() "fixed_to_arithmetic integrals"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { expect_eq(fixed_to_arithmetic(0.25_fix), 0); expect_eq(fixed_to_arithmetic(1.25_fix), 1); @@ -93,7 +93,7 @@ int main() }; "fixed_to_arithmetic floating point"_test = [&result] { - auto fn_tmpl = [] -> metatests::test_result + auto fn_tmpl = []() -> metatests::test_result { { static constexpr auto approx{std::numeric_limits::epsilon()}; From ef0ab03de7623e551914a45ec9216ae1b4864c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Ba=C4=87?= Date: Mon, 12 Aug 2024 13:07:10 +0200 Subject: [PATCH 10/10] fix msvc toolset --- unit_tests/addition_ut.cc | 4 +++- unit_tests/atan_ut.cc | 6 ++++++ unit_tests/misc_functions_ut.cc | 3 +++ unit_tests/sin_cos_ut.cc | 6 ++++++ unit_tests/subtraction_ut.cc | 3 +++ unit_tests/tan_ut.cc | 3 +++ unit_tests/type_convertions_ut.cc | 6 ++++++ 7 files changed, 30 insertions(+), 1 deletion(-) diff --git a/unit_tests/addition_ut.cc b/unit_tests/addition_ut.cc index 9b9c48b..9aee4b7 100644 --- a/unit_tests/addition_ut.cc +++ b/unit_tests/addition_ut.cc @@ -5,6 +5,8 @@ using boost::ut::operator""_test; using namespace metatests; using namespace fixedmath; +static constexpr auto msvc_nonsense_non_constexpr_fix_max_ { limits_::max() }; + int main() { test_result result; @@ -40,7 +42,7 @@ int main() expect_lt(limits_::max(), limits_::quiet_NaN()); expect_neq(limits_::lowest() + 1, limits_::quiet_NaN()); - expect_neq(as_fixed(limits_::max().v - 65536) + 1_fix, limits_::quiet_NaN()); + expect_neq(as_fixed(msvc_nonsense_non_constexpr_fix_max_.v - 65536) + 1_fix, limits_::quiet_NaN()); expect( test_resulting_type( int64_t(1) + 1_fix ) ); expect( test_resulting_type( 1_fix + int64_t(1) ) ); diff --git a/unit_tests/atan_ut.cc b/unit_tests/atan_ut.cc index 76ba58d..4c7c603 100644 --- a/unit_tests/atan_ut.cc +++ b/unit_tests/atan_ut.cc @@ -50,7 +50,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; "atan2"_test = [&result] @@ -383,7 +386,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; } diff --git a/unit_tests/misc_functions_ut.cc b/unit_tests/misc_functions_ut.cc index 222bd02..a2d93ea 100644 --- a/unit_tests/misc_functions_ut.cc +++ b/unit_tests/misc_functions_ut.cc @@ -44,7 +44,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; "angle_to_radians"_test = [&result] diff --git a/unit_tests/sin_cos_ut.cc b/unit_tests/sin_cos_ut.cc index 0d5ad7a..8dac4dd 100644 --- a/unit_tests/sin_cos_ut.cc +++ b/unit_tests/sin_cos_ut.cc @@ -72,7 +72,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; "cos"_test = [&result] @@ -97,7 +100,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; } diff --git a/unit_tests/subtraction_ut.cc b/unit_tests/subtraction_ut.cc index b049b41..e145685 100644 --- a/unit_tests/subtraction_ut.cc +++ b/unit_tests/subtraction_ut.cc @@ -55,6 +55,9 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; } diff --git a/unit_tests/tan_ut.cc b/unit_tests/tan_ut.cc index ed89ec3..d061d72 100644 --- a/unit_tests/tan_ut.cc +++ b/unit_tests/tan_ut.cc @@ -30,7 +30,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; } diff --git a/unit_tests/type_convertions_ut.cc b/unit_tests/type_convertions_ut.cc index 6be1bb3..86c6d52 100644 --- a/unit_tests/type_convertions_ut.cc +++ b/unit_tests/type_convertions_ut.cc @@ -89,7 +89,10 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; "fixed_to_arithmetic floating point"_test = [&result] { @@ -123,6 +126,9 @@ int main() return {}; }; result |= run_runtime_test(fn_tmpl); +#if !defined(_MSC_VER) || defined(__clang__) + // skip msvc toolset undebugable nonsense consteval errors for completely valid code result |= run_consteval_test(fn_tmpl); +#endif }; }