diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 45e8132..7ce11c1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - os: [ windows-2022, ubuntu-20.04 ] + os: [ windows-2022, ubuntu-20.04, macos-15 ] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 5775169..c0302f6 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ The implementation does not guarantee the best performance under all use cases b | -------------------- | ---------------- | ------------------ | | GCC >= 11.1.0 | libstdc++ | Ubuntu 20.04 | | MSVC >= 14.30 | Microsoft STL | Visual Studio 2022 | +| Clang >= 17.0.6 | libc++ | Xcode 16.0 | ## Installation diff --git a/include/std23/__functional_base.h b/include/std23/__functional_base.h index 8edb81e..93675a9 100644 --- a/include/std23/__functional_base.h +++ b/include/std23/__functional_base.h @@ -47,17 +47,17 @@ template inline constexpr bool _is_not_self = not std::is_same_v, Self>; -template class> +template class> inline constexpr bool _looks_nullable_to_impl = std::is_member_pointer_v; -template class Self> +template class Self> inline constexpr bool _looks_nullable_to_impl = std::is_function_v; template class Self> inline constexpr bool _looks_nullable_to_impl, Self> = true; -template class Self> +template class Self> inline constexpr bool _looks_nullable_to = _looks_nullable_to_impl, Self>; diff --git a/include/std23/function.h b/include/std23/function.h index 5158451..63966fc 100644 --- a/include/std23/function.h +++ b/include/std23/function.h @@ -314,7 +314,7 @@ template class function explicit operator bool() const noexcept { constexpr empty_target_object null; - return __builtin_memcmp(storage_, &null, sizeof(void *)) != 0; + return __builtin_memcmp(storage_, (void *)&null, sizeof(void *)) != 0; } friend bool operator==(function const &f, nullptr_t) noexcept { return !f; } diff --git a/tests/function/test_ctad.cpp b/tests/function/test_ctad.cpp index a81c0a1..a88576f 100644 --- a/tests/function/test_ctad.cpp +++ b/tests/function/test_ctad.cpp @@ -7,13 +7,14 @@ inline constexpr bool deduction_enabled = type_traits::is_valid( void test_ctad() { { - function fn = [i = 0] { return 0; }; + function fn = [i = 0] { return i; }; static_assert(std::is_same_v>); static_assert(std::is_same_v); } { - function fn = [i = 0](int &&, int const) mutable { return "lit"; }; + function fn = [i = 0](int &&, int const) mutable + { return (void)i, "lit"; }; static_assert( std::is_same_v>); static_assert(std::is_same_v); @@ -27,7 +28,7 @@ void test_ctad() } { - function fn = [i = 0]() noexcept { return 0; }; + function fn = [i = 0]() noexcept { return i; }; static_assert(std::is_same_v>, "[func.wrap.func.con]/16"); static_assert(std::is_same_v); diff --git a/tests/function_ref/test_call_pattern.cpp b/tests/function_ref/test_call_pattern.cpp index ebd87ce..7d50233 100644 --- a/tests/function_ref/test_call_pattern.cpp +++ b/tests/function_ref/test_call_pattern.cpp @@ -67,7 +67,7 @@ suite call_pattern = [] { expect(fr() == some_str); - auto fn = [i = 0] { return some_str.data(); }; + auto fn = [i = 0] { return (void)i, some_str.data(); }; fr = decltype(fr)(fn); expect(fr() == some_str); diff --git a/tests/move_only_function/CMakeLists.txt b/tests/move_only_function/CMakeLists.txt index 91dba64..87e051c 100644 --- a/tests/move_only_function/CMakeLists.txt +++ b/tests/move_only_function/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources(run-move_only_function PRIVATE "test_unique.cpp" ) target_compile_options(run-move_only_function PRIVATE + $<$:-Wno-self-move> $<$:-fsized-deallocation>) target_link_libraries(run-move_only_function PRIVATE nontype_functional kris-ut) set_target_properties(run-move_only_function PROPERTIES OUTPUT_NAME run)