[PATCH] D38627: [clangd] Added move-only function helpers.
NAKAMURA Takumi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 10 00:42:04 PDT 2017
chapuni added a comment.
Excuse me, Ubuntu 14.04's g++-4.8.4 doesn't compile it. :(
Any idea?
In file included from clang-tools-extra/clangd/ClangdServer.h:23:0,
from clang-tools-extra/clangd/ClangdServer.cpp:10:
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23, std::promise<void>, std::future<void> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: no match for call to ‘(clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23, std::promise<void>, std::future<void> >) ()’
Ret Call(Args... As) override { return Func(std::forward<Args>(As)...); }
^
clang-tools-extra/clangd/Function.h:82:45: note: candidate is:
template <class Func, class... Args> struct ForwardBinder {
^
clang-tools-extra/clangd/Function.h:108:8: note: template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23; Args = {std::promise<void>, std::future<void>}]
auto operator()(RestArgs &&... Rest)
^
clang-tools-extra/clangd/Function.h:108:8: note: template argument deduction/substitution failed:
clang-tools-extra/clangd/Function.h: In substitution of ‘template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23; Args = {std::promise<void>, std::future<void>}] [with RestArgs = {}]’:
clang-tools-extra/clangd/Function.h:68:74: required from ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23, std::promise<void>, std::future<void> >; Ret = void; Args = {}]’
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:110:59: error: cannot call member function ‘decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::CallImpl(llvm::integer_sequence<long unsigned int, Indexes ...>, RestArgs&& ...) [with long unsigned int ...Indexes = {0ul, 1ul}; RestArgs = {}; Func = clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23; Args = {std::promise<void>, std::future<void>}; decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) = void]’ without object
std::forward<RestArgs>(Rest)...)) {
^
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleCancelRebuild(std::shared_ptr<clang::clangd::CppFile>)::__lambda23, std::promise<void>, std::future<void> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: return-statement with a value, in function returning 'void' [-fpermissive]
Ret Call(Args... As) override { return Func(std::forward<Args>(As)...); }
^
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22, std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: no match for call to ‘(clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22, std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void> >) ()’
clang-tools-extra/clangd/Function.h:82:45: note: candidate is:
template <class Func, class... Args> struct ForwardBinder {
^
clang-tools-extra/clangd/Function.h:108:8: note: template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22; Args = {std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void>}]
auto operator()(RestArgs &&... Rest)
^
clang-tools-extra/clangd/Function.h:108:8: note: template argument deduction/substitution failed:
clang-tools-extra/clangd/Function.h: In substitution of ‘template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22; Args = {std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void>}] [with RestArgs = {}]’:
clang-tools-extra/clangd/Function.h:68:74: required from ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22, std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void> >; Ret = void; Args = {}]’
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:110:59: error: cannot call member function ‘decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::CallImpl(llvm::integer_sequence<long unsigned int, Indexes ...>, RestArgs&& ...) [with long unsigned int ...Indexes = {0ul, 1ul}; RestArgs = {}; Func = clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22; Args = {std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void>}; decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) = void]’ without object
std::forward<RestArgs>(Rest)...)) {
^
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::scheduleReparseAndDiags(clang::clangd::PathRef, clang::clangd::VersionedDraft, std::shared_ptr<clang::clangd::CppFile>, clang::clangd::Tagged<llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem> >)::__lambda22, std::future<llvm::Optional<std::vector<clang::clangd::DiagWithFixIts, std::allocator<clang::clangd::DiagWithFixIts> > > >, std::promise<void> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: return-statement with a value, in function returning 'void' [-fpermissive]
Ret Call(Args... As) override { return Func(std::forward<Args>(As)...); }
^
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17, std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: no match for call to ‘(clang::clangd::ForwardBinder<clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17, std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()> >) ()’
clang-tools-extra/clangd/Function.h:82:45: note: candidate is:
template <class Func, class... Args> struct ForwardBinder {
^
clang-tools-extra/clangd/Function.h:108:8: note: template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17; Args = {std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()>}]
auto operator()(RestArgs &&... Rest)
^
clang-tools-extra/clangd/Function.h:108:8: note: template argument deduction/substitution failed:
clang-tools-extra/clangd/Function.h: In substitution of ‘template<class ... RestArgs> decltype (CallImpl(llvm::index_sequence_for<Iters ...>(), (forward<RestArgs>)(clang::clangd::ForwardBinder::operator()::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::operator()(RestArgs&& ...) [with RestArgs = {RestArgs ...}; Func = clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17; Args = {std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()>}] [with RestArgs = {}]’:
clang-tools-extra/clangd/Function.h:68:74: required from ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17, std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()> >; Ret = void; Args = {}]’
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:110:59: error: cannot call member function ‘decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) clang::clangd::ForwardBinder<Func, Args>::CallImpl(llvm::integer_sequence<long unsigned int, Indexes ...>, RestArgs&& ...) [with long unsigned int ...Indexes = {0ul}; RestArgs = {}; Func = clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17; Args = {std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()>}; decltype (get<0>(this->.FuncWithArguments)((forward<Args>)((get<Indexes + 1>)(this->.FuncWithArguments))..., (forward<RestArgs>)(clang::clangd::ForwardBinder::CallImpl::Rest)...)) = void]’ without object
std::forward<RestArgs>(Rest)...)) {
^
clang-tools-extra/clangd/Function.h: In instantiation of ‘Ret clang::clangd::UniqueFunction<Ret(Args ...)>::FunctionCallImpl<Callable>::Call(Args ...) [with Callable = clang::clangd::ForwardBinder<clang::clangd::ClangdServer::codeComplete(clang::clangd::PathRef, clang::clangd::Position, llvm::Optional<llvm::StringRef>, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>*)::__lambda17, std::packaged_task<clang::clangd::Tagged<std::vector<clang::clangd::CompletionItem, std::allocator<clang::clangd::CompletionItem> > >()> >; Ret = void; Args = {}]’:
clang-tools-extra/clangd/ClangdServer.cpp:484:1: required from here
clang-tools-extra/clangd/Function.h:68:74: error: return-statement with a value, in function returning 'void' [-fpermissive]
Ret Call(Args... As) override { return Func(std::forward<Args>(As)...); }
^
Repository:
rL LLVM
https://reviews.llvm.org/D38627
More information about the cfe-commits
mailing list