[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 15:27:09 PDT 2022
On Thu, Aug 11, 2022 at 08:48:17PM +0100, Simon Pilgrim via llvm-commits wrote:
> I'm not certain, but have you overridden your system include paths at all?
>
> My hunch is that you're using pre c++17 headers which don't define
> std::invoke_result_t
No, I haven't. But FreeBSD 11.1 went out of support in 2018 and has no
mention of invoke_result_t in /usr/includes anywhere. I'll poke my management
about upgrading to something newer. In the meantime, can anything be done?
Can this be patched in tree or do I need to carry a patch myself?
> Simon.
>
> On 11/08/2022 20:16, Kevin P. Neal wrote:
> > 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.
> >
> >
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Kevin P. Neal from "Crito" by Plato, 360 BCE:
"But why, my dear Crito, should we care about the opinion of the many?
Good men, and they are the persons who are worth considering, will
think of these things truly as they happened." - Socrates
More information about the llvm-commits
mailing list