[llvm] adb0cd6 - [Support] TaskQueue.h - replace std::result_of_t with std::invoke_result_t
Kevin P. Neal via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 12:16:45 PDT 2022
On Tue, Aug 09, 2022 at 02:53:28AM -0700, Simon Pilgrim via llvm-commits wrote:
>
> Author: Simon Pilgrim
> Date: 2022-08-09T10:52:39+01:00
> New Revision: adb0cd62a98cca26c740364bca308d089bb07cc1
>
> URL: https://github.com/llvm/llvm-project/commit/adb0cd62a98cca26c740364bca308d089bb07cc1
> DIFF: https://github.com/llvm/llvm-project/commit/adb0cd62a98cca26c740364bca308d089bb07cc1.diff
>
> LOG: [Support] TaskQueue.h - replace std::result_of_t with std::invoke_result_t
>
> std::result_of_t is deprecated in C++17
>
> Fixes #57023
I'm now seeing this build failure on FreeBSD 11.1:
FAILED: unittests/Support/CMakeFiles/SupportTests.dir/TaskQueueTest.cpp.o
/.../u/saskpn/llvm-trunk/b64nd/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/Support -I/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support -Iinclude -I/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include -I/.../u/saskpn/clvm/trunk/llvm-latest/llvm/utils/unittest/googletest/include -I/.../u/saskpn/clvm/trunk/llvm-latest/llvm/utils/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -g -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -Wno-suggest-override -std=c++17 -MD -MT unittests/Support/CMakeFiles/SupportTests.dir/TaskQueueTest.cpp.o -MF unittests/Support/CMakeFiles/SupportTests.dir/TaskQueueTest.cpp.o.d -o unittests/Support/CMakeFiles/SupportTests.dir/TaskQueueTest.cpp.o -c /.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp
In file included from /.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:13:
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:41:27: error: no template named 'invoke_result_t' in namespace 'std'
using ResultTy = std::invoke_result_t<Callable>;
~~~~~^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:63:34: error: use of undeclared identifier 'ResultTy'
std::shared_ptr<std::promise<ResultTy>> P;
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:81:20: error: no member named 'invoke_result_t' in namespace 'std'
std::future<std::invoke_result_t<Callable>> async(Callable &&C) {
~~~~~^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:81:36: error: 'Callable' does not refer to a value
std::future<std::invoke_result_t<Callable>> async(Callable &&C) {
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:80:22: note: declared here
template <typename Callable>
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:81:45: error: expected member name or ';' after declaration specifiers
std::future<std::invoke_result_t<Callable>> async(Callable &&C) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:43:60: error: use of undeclared identifier 'ResultTy'
: C(std::move(C)), P(std::make_shared<std::promise<ResultTy>>()),
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:57:7: error: unknown type name 'ResultTy'
ResultTy *Dummy = nullptr;
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:59:15: error: no member named 'completeTask' in 'llvm::TaskQueue'
Parent->completeTask();
~~~~~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:69:38: error: member initializer 'Scheduler' does not name a non-static data member or base class
TaskQueue(ThreadPool &Scheduler) : Scheduler(Scheduler) { (void)Scheduler; }
^~~~~~~~~~~~~~~~~~~~
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/include/llvm/Support/TaskQueue.h:73:5: error: use of undeclared identifier 'Scheduler'
Scheduler.wait();
^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:36:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F1 = TQ.async([&] {
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:40:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F2 = TQ.async([&] {
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:44:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F3 = TQ.async([&] {
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:78:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F1 = TQ.async([&] { ++X; });
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:79:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F2 = TQ.async([&] { ++Y; });
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:80:29: error: no member named 'async' in 'llvm::TaskQueue'
std::future<void> F3 = TQ.async([&M, &Z] {
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:101:36: error: no member named 'async' in 'llvm::TaskQueue'
std::future<std::string> F1 = TQ.async([&] { return std::string("Hello"); });
~~ ^
/.../u/saskpn/clvm/trunk/llvm-latest/llvm/unittests/Support/TaskQueueTest.cpp:102:28: error: no member named 'async' in 'llvm::TaskQueue'
std::future<int> F2 = TQ.async([&] { return 42; });
~~ ^
18 errors generated.
[695/817] Linking CXX executable unittests/MI/MITests
ninja: build stopped: subcommand failed.
--
"A method for inducing cats to exercise consists of directing a beam of
invisible light produced by a hand-held laser apparatus onto the floor ...
in the vicinity of the cat, then moving the laser ... in an irregular way
fascinating to cats,..." -- US patent 5443036, "Method of exercising a cat"
More information about the llvm-commits
mailing list