Skip to content

error: 'result_of<(lambda at /tmp/sourcepawn/vm/watchdog_timer.cpp:60:50) &()>' is deprecated: use 'std::invoke_result' instead #131

Open
@peace-maker

Description

@peace-maker

Trying to compile sourcepawn on Ubuntu 24.04 with clang 18 fails.

[2982] clang++ -m64 -pipe -Wall -Werror -Wno-switch -fvisibility=hidden -O3 -fPIC -Wno-invalid-offsetof -g3 -std=c++17 -fvisibility-inlines-hidden -Wno-delete-non-virtual-dtor -Wno-unused-private-field -fno-rtti -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-implicit-exception-spec-mismatch -DNDEBUG -DKE_THREADSAFE -D_GNU_SOURCE -I /tmp/sourcepawn -I /tmp/sourcepawn/include -I /tmp/sourcepawn/third_party -I /tmp/sourcepawn/third_party/amtl -I /tmp/sourcepawn/objdir/includes -I /tmp/sourcepawn/third_party/amtl -I /tmp/sourcepawn/include -I /tmp/sourcepawn/vm -MD -MF watchdog_timer.d -c /tmp/sourcepawn/vm/watchdog_timer.cpp -o watchdog_timer.o
In file included from /tmp/sourcepawn/vm/watchdog_timer.cpp:21:
In file included from /tmp/sourcepawn/third_party/amtl/amtl/am-thread.h:32:
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/functional:552:2: error: 'result_of<(lambda at /tmp/sourcepawn/vm/watchdog_timer.cpp:60:50) &()>' is deprecated: use 'std::invoke_result' instead [-Werror,-Wdeprecated-declarations]
  552 |         using _Res_type_impl
      |         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/functional:556:2: note: in instantiation of template type alias '_Res_type_impl' requested here
  556 |         using _Res_type = _Res_type_impl<_Functor, _CallArgs, _Bound_args...>;
      |         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/functional:586:28: note: in instantiation of template type alias '_Res_type' requested here
  586 |                typename _Result = _Res_type<tuple<_Args...>>>
      |                                   ^
/tmp/sourcepawn/third_party/amtl/amtl/am-thread.h:104:21: note: in instantiation of template class 'std::_Bind<(lambda at /tmp/sourcepawn/vm/watchdog_timer.cpp:60:50) ()>' requested here
  104 |     auto callback = std::bind(std::forward<Function>(f), std::forward<Args>(args)...);
      |                     ^
/tmp/sourcepawn/vm/watchdog_timer.cpp:60:17: note: in instantiation of function template specialization 'ke::NewThread<(lambda at /tmp/sourcepawn/vm/watchdog_timer.cpp:60:50)>' requested here
   60 |   thread_ = ke::NewThread("SourcePawn Watchdog", [this]() -> void {
      |                 ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/type_traits:2590:9: note: 'result_of<(lambda at /tmp/sourcepawn/vm/watchdog_timer.cpp:60:50) &()>' has been explicitly marked deprecated here
 2590 |     { } _GLIBCXX17_DEPRECATED_SUGGEST("std::invoke_result");
      |         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13/bits/c++config.h:122:45: note: expanded from macro '_GLIBCXX17_DEPRECATED_SUGGEST'
  122 | # define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
      |                                             ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13/bits/c++config.h:98:19: note: expanded from macro '_GLIBCXX_DEPRECATED_SUGGEST'
   98 |   __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
      |                   ^
1 error generated.
Build failed: libsourcepawn_static/linux-x86_64/vm/watchdog_timer.o

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions