cpr icon indicating copy to clipboard operation
cpr copied to clipboard

Build failure on macOS 10.15: `error: no viable constructor or deduction guide for deduction of template arguments of 'function'`

Open barracuda156 opened this issue 1 year ago • 1 comments

Description

[ 95%] Building CXX object test/CMakeFiles/ssl_tests.dir/ssl_tests.cpp.o
cd /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/build/test && /usr/bin/clang++ -DCPR_BUILD_TESTS -DCPR_BUILD_TESTS_SSL -DCPR_ENABLE_CURL_HTTP_ONLY -DCPR_ENABLE_SSL -DCPR_FORCE_OPENSSL_BACKEND -DCPR_USE_SYSTEM_CURL -DCPR_USE_SYSTEM_GTEST -DMG_ENABLE_OPENSSL -DOPENSSL_BACKEND_USED -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/build/_deps/mongoose-src -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/build/cpr_generated_includes -isystem /opt/local/include -pipe -I/opt/local/libexec/openssl3/include -Os -Wno-error=overflow -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wall -Wextra -Wpedantic -Werror -std=gnu++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -MD -MT test/CMakeFiles/ssl_tests.dir/ssl_tests.cpp.o -MF CMakeFiles/ssl_tests.dir/ssl_tests.cpp.o.d -o CMakeFiles/ssl_tests.dir/ssl_tests.cpp.o -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/ssl_tests.cpp
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:316:25: error: no viable constructor or deduction guide for deduction of template arguments of 'function'
    const std::function observer_fn{[](cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, intptr_t) -> bool {
                        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate template ignored: could not match 'function<_Fp>' against '(lambda at /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:316:37)'
template<class _Fp> class _LIBCPP_TEMPLATE_VIS function; // undefined
                                               ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate function template not viable: requires 0 arguments, but 1 was provided
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:345:25: error: no viable constructor or deduction guide for deduction of template arguments of 'function'
    const std::function observer_fn{[](cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, intptr_t) -> bool {
                        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate template ignored: could not match 'function<_Fp>' against '(lambda at /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:345:37)'
template<class _Fp> class _LIBCPP_TEMPLATE_VIS function; // undefined
                                               ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate function template not viable: requires 0 arguments, but 1 was provided
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:377:25: error: no viable constructor or deduction guide for deduction of template arguments of 'function'
    const std::function observer_fn{[](cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, intptr_t) -> bool {
                        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate template ignored: could not match 'function<_Fp>' against '(lambda at /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:377:37)'
template<class _Fp> class _LIBCPP_TEMPLATE_VIS function; // undefined
                                               ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate function template not viable: requires 0 arguments, but 1 was provided
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:418:25: error: no viable constructor or deduction guide for deduction of template arguments of 'function'
    const std::function observer_fn{[N](cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, cpr_pf_arg_t, intptr_t) -> bool {
                        ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate template ignored: could not match 'function<_Fp>' against '(lambda at /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_cpr/cpr/work/cpr-1.10.5/test/multiasync_tests.cpp:418:37)'
template<class _Fp> class _LIBCPP_TEMPLATE_VIS function; // undefined
                                               ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:1430:48: note: candidate function template not viable: requires 0 arguments, but 1 was provided

Buildbot log: https://build.macports.org/builders/ports-10.15_x86_64-builder/builds/192100/steps/install-port/logs/stdio

Example/How to Reproduce

On Catalina run:

sudo port -v build cpr

Possible Fix

No response

Where did you get it from?

Other (specify in "Additional Context/Your Environment")

Additional Context/Your Environment

  • OS: macOS
  • Version: 10.15
  • MacPorts

barracuda156 avatar Jul 28 '24 09:07 barracuda156

@barracuda156 thanks for reporting! Fixed in https://github.com/libcpr/cpr/pull/1098. Can you confirm?

COM8 avatar Aug 17 '24 06:08 COM8