Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail to build #288

Closed
yurivict opened this issue Aug 15, 2023 · 36 comments
Closed

Tests fail to build #288

yurivict opened this issue Aug 15, 2023 · 36 comments

Comments

@yurivict
Copy link

-- Build files have been written to: /usr/ports/devel/outcome/work/.build
[ 16% 2/6] /usr/bin/c++  -I/usr/ports/devel/outcome/work/outcome-2.2.7/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fexceptions -frtti -fstack-protector-strong -Winvalid-pch -fpch-instantiate-templates -Xclang -emit-pch -Xclang -include -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx -x c++-header -MD -MT CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch -MF CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch.d -o CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch -c /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.cxx
[ 33% 3/6] /usr/bin/c++  -I/usr/ports/devel/outcome/work/outcome-2.2.7/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fexceptions -frtti -fstack-protector-strong -Winvalid-pch -fpch-instantiate-templates -Xclang -emit-pch -Xclang -include -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_2.dir/cmake_pch.hxx -x c++-header -MD -MT CMakeFiles/outcome-dependency-smoke-test_2.dir/cmake_pch.hxx.pch -MF CMakeFiles/outcome-dependency-smoke-test_2.dir/cmake_pch.hxx.pch.d -o CMakeFiles/outcome-dependency-smoke-test_2.dir/cmake_pch.hxx.pch -c /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_2.dir/cmake_pch.hxx.cxx
[ 50% 4/6] /usr/bin/c++  -I/usr/ports/devel/outcome/work/outcome-2.2.7/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fexceptions -frtti -fstack-protector-strong -Winvalid-pch -Xclang -include-pch -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx -MD -MT CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -c /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp
FAILED: CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o 
/usr/bin/c++  -I/usr/ports/devel/outcome/work/outcome-2.2.7/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fexceptions -frtti -fstack-protector-strong -Winvalid-pch -Xclang -include-pch -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx -MD -MT CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -c /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1185:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_();  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:131:11: note: in instantiation of function template specialization 'outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>::value_storage_nontrivial<std::error_code, true>' requested here
        : _state(o._state)
          ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:456:9: note: in instantiation of function template specialization 'outcome_v2::detail::basic_result_storage<udt5, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<udt5, std::error_code, void>>::basic_result_storage<void, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<void, std::error_code, void>>' requested here
      : base{typename base::compatible_conversion_tag(), o}
        ^
/usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp:406:18: note: in instantiation of function template specialization 'outcome_v2::basic_result<udt5, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<udt5, std::error_code, void>>::basic_result<void, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<void, std::error_code, void>, true>' requested here
    result<udt5> k7(k6);
                 ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1200:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_();  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:137:11: note: in instantiation of function template specialization 'outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>::value_storage_nontrivial<std::error_code, true>' requested here
        : _state(static_cast<decltype(o._state) &&>(o._state))
          ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:469:9: note: in instantiation of function template specialization 'outcome_v2::detail::basic_result_storage<udt5, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<udt5, std::error_code, void>>::basic_result_storage<void, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<void, std::error_code, void>>' requested here
      : base{typename base::compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
        ^
/usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp:407:18: note: in instantiation of function template specialization 'outcome_v2::basic_result<udt5, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<udt5, std::error_code, void>>::basic_result<void, std::error_code, outcome_v2::policy::error_code_throw_as_system_error<void, std::error_code, void>, true>' requested here
    result<udt5> k8(std::move(k6));
                 ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1222:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_(o._value);  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:131:11: note: in instantiation of function template specialization 'outcome_v2::detail::value_storage_nontrivial<udt5, int>::value_storage_nontrivial<int, true>' requested here
        : _state(o._state)
          ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:456:9: note: in instantiation of function template specialization 'outcome_v2::detail::basic_result_storage<udt5, int, outcome_v2::policy::fail_to_compile_observers>::basic_result_storage<int, void, outcome_v2::policy::terminate>' requested here
      : base{typename base::compatible_conversion_tag(), o}
        ^
/usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp:410:23: note: in instantiation of function template specialization 'outcome_v2::basic_result<udt5, int, outcome_v2::policy::fail_to_compile_observers>::basic_result<int, void, outcome_v2::policy::terminate, true>' requested here
    result<udt5, int> k10(k9);
                      ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1237:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_(static_cast<_value_type_ &&>(o._value));  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:137:11: note: in instantiation of function template specialization 'outcome_v2::detail::value_storage_nontrivial<udt5, int>::value_storage_nontrivial<int, true>' requested here
        : _state(static_cast<decltype(o._state) &&>(o._state))
          ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:469:9: note: in instantiation of function template specialization 'outcome_v2::detail::basic_result_storage<udt5, int, outcome_v2::policy::fail_to_compile_observers>::basic_result_storage<int, void, outcome_v2::policy::terminate>' requested here
      : base{typename base::compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
        ^
/usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp:411:23: note: in instantiation of function template specialization 'outcome_v2::basic_result<udt5, int, outcome_v2::policy::fail_to_compile_observers>::basic_result<int, void, outcome_v2::policy::terminate, true>' requested here
    result<udt5, int> k11(std::move(k9));
                      ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1075:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_(o._value);  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1462:5: note: in instantiation of member function 'outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>::value_storage_nontrivial' requested here
    value_storage_nontrivial_move_assignment(const value_storage_nontrivial_move_assignment &) = default;
    ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1058:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(_value)) _value_type_(static_cast<_value_type_ &&>(o._value));  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1463:5: note: in instantiation of member function 'outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>::value_storage_nontrivial' requested here
    value_storage_nontrivial_move_assignment(value_storage_nontrivial_move_assignment &&) = default;  // NOLINT
    ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
In file included from <built-in>:416:
In file included from /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx:5:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome.hpp:27:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/iostream_support.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/outcome.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/../../include/outcome/result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/std_result.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:29:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/convert.hpp:28:
In file included from /usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:30:
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1510:9: error: no matching constructor for initialization of 'move_assign_to_empty<_value_type_>' (aka 'move_assign_to_empty<udt5>')
        move_assign_to_empty<_value_type_>(OUTCOME_ADDRESS_OF(this->_value), OUTCOME_ADDRESS_OF(o._value));
        ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1566:111: note: in instantiation of member function 'outcome_v2::detail::value_storage_nontrivial_move_assignment<outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>>::operator=' requested here
    value_storage_nontrivial_copy_assignment &operator=(value_storage_nontrivial_copy_assignment &&o) = default;  // NOLINT
                                                                                                              ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:48:5: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'udt5 *' for 1st argument
    move_assign_to_empty(T *dest, T *o) noexcept(std::is_nothrow_move_constructible<T>::value) { new(dest) T(static_cast<T &&>(*o)); }
    ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:46:29: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
  template <class T> struct move_assign_to_empty<T, true, true>
                            ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:46:29: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1549:9: error: no matching constructor for initialization of 'move_assign_to_empty<_value_type_>' (aka 'move_assign_to_empty<udt5>')
        move_assign_to_empty<_value_type_>(OUTCOME_ADDRESS_OF(this->_value), OUTCOME_ADDRESS_OF(o._value));
        ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:48:5: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'udt5 *' for 1st argument
    move_assign_to_empty(T *dest, T *o) noexcept(std::is_nothrow_move_constructible<T>::value) { new(dest) T(static_cast<T &&>(*o)); }
    ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:46:29: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
  template <class T> struct move_assign_to_empty<T, true, true>
                            ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:46:29: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1607:9: error: no matching constructor for initialization of 'copy_assign_to_empty<_value_type_>' (aka 'copy_assign_to_empty<udt5>')
        copy_assign_to_empty<_value_type_>(OUTCOME_ADDRESS_OF(this->_value), OUTCOME_ADDRESS_OF(o._value));
        ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/detail/basic_result_storage.hpp:96:75: note: in instantiation of member function 'outcome_v2::detail::value_storage_nontrivial_copy_assignment<outcome_v2::detail::value_storage_nontrivial_move_assignment<outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>>>::operator=' requested here
    basic_result_storage &operator=(const basic_result_storage &) = default;  // NOLINT
                                                                          ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:83:5: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'udt5 *' for 1st argument
    copy_assign_to_empty(T *dest, const T *o) noexcept(std::is_nothrow_copy_constructible<T>::value) { new(dest) T(*o); }
    ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:81:29: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
  template <class T> struct copy_assign_to_empty<T, true, true>
                            ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:81:29: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1642:9: error: no matching constructor for initialization of 'copy_assign_to_empty<_value_type_>' (aka 'copy_assign_to_empty<udt5>')
        copy_assign_to_empty<_value_type_>(OUTCOME_ADDRESS_OF(this->_value), OUTCOME_ADDRESS_OF(o._value));
        ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:83:5: note: candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'udt5 *' for 1st argument
    copy_assign_to_empty(T *dest, const T *o) noexcept(std::is_nothrow_copy_constructible<T>::value) { new(dest) T(*o); }
    ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:81:29: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
  template <class T> struct copy_assign_to_empty<T, true, true>
                            ^
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:81:29: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/policy/../detail/value_storage.hpp:1328:9: error: no matching function for call to 'operator new'
        new(OUTCOME_ADDRESS_OF(o._value)) _value_type_(static_cast<_value_type_ &&>(_value));  // NOLINT
        ^~~
/usr/ports/devel/outcome/work/outcome-2.2.7/include/outcome/basic_result.hpp:694:18: note: in instantiation of member function 'outcome_v2::detail::value_storage_nontrivial<udt5, std::error_code>::swap' requested here
    this->_state.swap(o._state);
                 ^
/usr/include/c++/v1/new:192:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'const std::nothrow_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^
/usr/include/c++/v1/new:208:66: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'std::align_val_t' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:225:70: note: candidate function not viable: cannot convert argument of incomplete type 'void' to 'void *' for 2nd argument
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}
                                                                     ^
/usr/include/c++/v1/new:191:66: note: candidate function not viable: requires single argument '__sz', but 2 arguments were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
                                                                 ^
/usr/include/c++/v1/new:209:66: note: candidate function not viable: requires 3 arguments, but 2 were provided
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
                                                                 ^

Version: 2.2.7
clang-15
FreeBSD 13.2

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

I added a FreeBSD CI runner to Outcome, and everything compiles and all tests pass: https://github.com/ned14/outcome/actions/runs/5868214302/job/15910531563

I think the problem is your side of things?

@yurivict
Copy link
Author

It's puzzling, I can't see what is wrong.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Your clang is trying to new(addr) void which shouldn't be possible, because void gets stripped out by devoid<T>. This is devoid<T>:

  struct void_type
  {
    // We always compare true to another instance of me
    constexpr bool operator==(void_type /*unused*/) const noexcept { return true; }
    constexpr bool operator!=(void_type /*unused*/) const noexcept { return false; }
  };
  template <class T> using devoid = std::conditional_t<std::is_void<T>::value, void_type, T>;

So, somehow this isn't working on your clang. I would suspect the std::is_void is broken somehow.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

(Just to explain, clangs up to about 14 had good QoI, clangs 14 and after have become a hot mess of bug especially around type traits. In my last job we abandoned clang support entirely from it, and I'm getting very close to refusing to support clangs after 13 in all my open source until the clang maintainers fix their compiler)

@yurivict
Copy link
Author

What clang version is used in the tests?

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Whatever is the default with FreeBSD 13. I assume that's clang 11, which is the last reliable good clang. clang 12 began the descent into hot bug mess, clang 12 doesn't compile some correct code and it's got continually worse with every clang release since.

Yesterday I switched LLFIO's CI to use Ubuntu 22.04 for Linux, and its default clang still chokes on the default libstdc++. Nobody in Ubuntu LTS maintenance fixed it upstream, which is just awful.

@yurivict
Copy link
Author

I don't use templates intensely so I didn't notice this.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Since Google and Apple dropped most resourcing of clang things have been going steadily downhill for that compiler. MSVC is actually more reliable than clang nowadays for C++ 20, which says a very great deal. Google pulled most of its resourcing after WG21 refused to ABI break. Apple pulled most of its resourcing somewhat earlier once Swift was mature for new development. Intel throws a bit into clang, but its lead clang devs have been leaving recently due to a pay freeze. If Aaron (head of clang at Intel) decides to also move on from Intel, I don't know what remains for clang personally.

It's only going to get worse, clang has ever fewer full time devs keeping it going with time. GCC and MSVC are likely to become the only production quality C++ 23 compilers, assuming IBM doesn't purge their GCC full time devs in the name of cost efficiencies.

I don't know what all this means for FreeBSD long term. You can either stick to an older clang which actually works, direct scarce FreeBSD resources into fixing clang, or return to using GCC as the primary compiler. None of those options are palatable for BSD in my opinion. Sorry.

@yurivict
Copy link
Author

@ned14
Do you know what would be a testcase for the std::is_void malfunction?
I tries it with many types and it behaves correctly.

@jrtc27
Copy link

jrtc27 commented Aug 15, 2023

cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug && ninja test passes on universe13a, which is running FreeBSD 13.2 (userspace; kernel is 14.0). So this sounds like a local issue?

I'll note that devoid isn't relevant here, though, unless I'm mistaken. The issue is the placement new thinking that the memory you're trying to use is of type void rather than T *, i.e. the OUTCOME_ADDRESS_OF(_value) being of type void. Given that that's either (&_value) or (std::addressof(_value)) that makes no sense. I'll also note that OUTCOME_USE_STD_ADDRESSOF is defined to 1 solely for test/tests/core-result.cpp, which is what all the errors you're seeing are for. So it sounds to me like your local environment has an utterly-borked std::addressof?

FWIW:

[jrtc27@universe13a ~/outcome/build]$ uname -a
FreeBSD universe13a.freebsd.org 13.2-STABLE FreeBSD 14.0-CURRENT #0 main-n263287-2071e54c226a: Wed May 31 00:10:40 UTC 2023 root@build-14.freebsd.org:/usr/obj/usr/src/sys/CLUSTER14 amd64
[jrtc27@universe13a ~/outcome/build]$ c++ --version
FreeBSD clang version 15.0.7 (https://github.com/llvm/llvm-project.git llvmorg-15.0.7-0-g8dfdcc7b7bf6)
Target: x86_64-unknown-freebsd13.2
Thread model: posix
InstalledDir: /usr/bin

@yurivict
Copy link
Author

Do you know what would be a testcase for the std::addressof malfunction?

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

That's a good point - this is only occurring on @yurivict's build system when std::addressof() is actually used.

It's hard to imagine how the implementation of that function could be borked UNLESS something is overriding it with an overly accepting overload set. So, is there anything else being included before Outcome includes its stuff?

(I suggest dumping the preprocessor output, search it for addressof)

@jrtc27
Copy link

jrtc27 commented Aug 15, 2023

I mean, does:

#include <memory>
int x;
int *p = std::addressof(x);

even work on your system? I have no clue how your system is broken, other than to say it is not the same as seen on the FreeBSD cluster.

Have you tried doing a build inside Poudriere rather than /usr/ports with all your own system's pollution? That'd isolate it to something in ports messing with it vs something with your system configuration specifically.

@yurivict
Copy link
Author

This code:

int main() {
        int x;
        int *p1 = std::addressof(x);
        int *p2 = &x;

        std::cout << "p1=" << p1 << std::endl;
        std::cout << "p2=" << p2 << std::endl;
}       

prints same addresses for p1 and p2.


Have you tried doing a build inside Poudriere rather than /usr/ports with all your own system's pollution?

I do this for every port I work on.
The issue with tests, however, seems to be related to the compiler.

My compiler is clang-15.0.7

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

You could try including all the headers which value_storage.hpp does before your test above. Obviously with OUTCOME_ADDRESS_OF() using std::addressof. Something is getting dragged in there which breaks std::addressof, or maybe, OUTCOME_ADDRESS_OF().

@jrtc27
Copy link

jrtc27 commented Aug 15, 2023

This code:

int main() {
        int x;
        int *p1 = std::addressof(x);
        int *p2 = &x;

        std::cout << "p1=" << p1 << std::endl;
        std::cout << "p2=" << p2 << std::endl;
}       

prints same addresses for p1 and p2.

Ok, so it's more complicated. As @ned14 says, the only real way to figure out what on earth is going on is to look at the preprocessed output for that specific test file, i.e. run:

/usr/bin/c++  -I/usr/ports/devel/outcome/work/outcome-2.2.7/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -fexceptions -frtti -fstack-protector-strong -Winvalid-pch -Xclang -include-pch -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /usr/ports/devel/outcome/work/.build/CMakeFiles/outcome-dependency-smoke-test_1.dir/cmake_pch.hxx -o CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.i -E /usr/ports/devel/outcome/work/outcome-2.2.7/test/tests/core-result.cpp

and upload core-result.cpp.i somewhere.

My compiler is clang-15.0.7

So was I, and it worked just fine. So the compiler version isn't sufficient, nor is it necessarily necessary.

@yurivict
Copy link
Author

Here is core-result.cpp.i from my FreeBSD 13.2 system.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Why on earth is your clang implementing std::addressof() as a builtin? I see no gain, its default implementation is trivial C++.

template <class _Tp>
inline
__attribute__((__no_sanitize__("cfi"))) __attribute__((__visibility__("hidden"))) __attribute__((__exclude_from_explicit_instantiation__)) __attribute__((__abi_tag__("v15007")))
_Tp*
addressof(_Tp& __x) noexcept
{
    return __builtin_addressof(__x);
}
# 71 "/usr/include/c++/v1/__memory/addressof.h" 3
template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;

Your preprocessed output appears to not be defining OUTCOME_USE_STD_ADDRESSOF=1?

Have you tried disabling preprocessed headers? Outcome's CMakeLists.txt explicitly disables preprocessed headers for that TU.

@jrtc27
Copy link

jrtc27 commented Aug 15, 2023

Why on earth is your clang implementing std::addressof() as a builtin? I see no gain, its default implementation is trivial C++.

Same reason you switched from using & to std::addressof() optionally: because operator& can be overloaded.

Your preprocessed output appears to not be defining OUTCOME_USE_STD_ADDRESSOF=1?

Yeah, that's the problem here. You can see in fact in the command line that preprocessed headers are being used. And the instantiations that are being choked on are the ones where outcome tests having void operator&(), so are to be expected if you use & not std::addressof. So now the question is why CMake decided to do that.

@yurivict
Copy link
Author

Have you tried disabling preprocessed headers? Outcome's CMakeLists.txt explicitly disables preprocessed headers for that TU.

This uses outcome-2.2.7 sources verbatim. No patches are applied.
What exactly do I alter to disable preprocessed headers project-wide?

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Same reason you switched from using & to std::addressof() optionally: because operator& can be overloaded.

Anybody who defines an overload for taking the address of a char deserves everything they get.

Equally, library authors must try to not get in the way of user mischief, no matter how insane. So a builtin I suppose makes sense.

Yeah, that's the problem here. You can see in fact in the command line that preprocessed headers are being used.

It is very important that preprocessed headers are not used for core-result.cpp, as it defines OUTCOME_USE_STD_ADDRESSOF=1 right at its top. That would not interact well with a preprocessed header for obvious reasons.

So now the question is why CMake decided to do that.

Obviously cmake is doing what it's told on systems which are not @yurivict's.

Here are the lines which disable precompiled headers for core-result.cpp:

EXCEPT here's the thing: it's been omitted from the first set by accident.

@yurivict Try adding outcome_hl--core-result to that first list and see if it fixes your problem.

@BurningEnlightenment
Copy link
Collaborator

Try adding outcome_hl--core-result to that first list and see if it fixes your problem.

The dependency smoke test is defined way to late for that, aint it?

add_executable(outcome-dependency-smoke-test_1 "test/tests/core-result.cpp")

ned14 added a commit that referenced this issue Aug 15, 2023
@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

I've stopped precompiled headers being applied to that test in develop branch.

@BurningEnlightenment
Copy link
Collaborator

@ned14 Looking at his logs I believe its the dependency smoke tests that are causing trouble and they won't profit from that exclusion. See the line from his failure log:

FAILED: CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o 

So we need to do something like

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -367,8 +367,9 @@
   foreach(target ${OUTCOME_SMOKE_TESTS})
     target_link_libraries(${target} PRIVATE outcome::hl)
     set_target_properties(${target} PROPERTIES
       RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+      DISABLE_PRECOMPILE_HEADERS On
     )
     add_test(NAME ${target} CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel
       COMMAND $<TARGET_FILE:${target}> --reporter junit --out $<TARGET_FILE:${target}>.junit.xml
     )

@yurivict
Copy link
Author

Try adding outcome_hl--core-result to that first list and see if it fixes your problem.

Nothing changed.

ned14 added a commit that referenced this issue Aug 15, 2023
@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Fixed as per your suggestion.

@BurningEnlightenment
Copy link
Collaborator

@yurivict would you mind trying my patch?

@jrtc27
Copy link

jrtc27 commented Aug 15, 2023

Ah, yes, the FreeBSD port enables OUTCOME_ENABLE_DEPENDENCY_SMOKE_TEST. I guess that's something to add to CI's coverage.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

TBH I had assumed if vcpkg was passing it was not a problem. What I was missing is vcpkg doesn't include the addressof changes yet, so we would have encountered that issue then.

@yurivict
Copy link
Author

Tests are built successfully with rev. 1407d02

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Outstanding. Thanks for your patience, sorry it's been such a long trail. It had been my fault all along.

Can I close this ticket?

@yurivict
Copy link
Author

Sure, no problem at all!

Thanks for fixing this.

@ned14
Copy link
Owner

ned14 commented Aug 15, 2023

Thanks @yurivict . BTW I haven't forgotten LLFIO on FreeBSD, it's just I haven't had any free mornings before work recently, so I haven't been able to make forward progress. It does compile, it's just an unacceptable number of tests fail.

@yurivict
Copy link
Author

Thanks @ned14
No problem, please do this what it is comfortable. No rush.

Best,
Yuri

@BurningEnlightenment
Copy link
Collaborator

@yurivict After the havoc here I thought it might be a good idea to briefly check if I encounter similar issues during the vcpkg port update. And indeed I came across the fact that PROJECT_IS_DEPENDENCY had been replaced with ${PROJECT_NAME}_IS_DEPENDENCY (i.e. outcome_IS_DEPENDENCY in this case). I suggest configuring with -Doutcome_IS_DEPENDENCY=ON as that will completely disable precompiled headers. I'm unsure whether the INTERFACE precompiled headers would propagate into the installed target configs.

@yurivict
Copy link
Author

@ned14 With -Doutcome_IS_DEPENDENCY=ON tests aren't run, though (through the "test" target).
Currently they all run fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants