Opened 8 years ago

Closed 8 years ago

#10159 closed Bugs (fixed)

GCC 4.4 error sorry, unimplemented

Reported by: Niklas Angare <li51ckf02@…> Owned by: viboes
Milestone: Boost 1.57.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

A bunch of tests fail to compile on GCC 4.4 with -std=gnu++0x. Specifically it's my test runners NA-QNX650-SP1* on QNX 6.5.0 which are the only ones running that compiler configuration at the moment.

For example async__async_executor_p fails to compile with this message:

In file included from ../libs/thread/test/sync/futures/async/async_executor_pass.cpp:28:
../boost/thread/future.hpp: In function 'boost::future<Rp> boost::async(Executor&, R (*)(ArgTypes&& ...), ArgTypes&& ...)':
../boost/thread/future.hpp:3850: sorry, unimplemented: cannot expand 'typename boost::decay<ArgTypes>::type ...' into a fixed-length argument list
../boost/thread/future.hpp:3850: error: invalid type in declaration before ';' token
../boost/thread/future.hpp:3851: error: 'BF' is not a class type
../boost/thread/future.hpp:3851: error: 'result_type' in class 'BF' does not name a type
../boost/thread/future.hpp:3851: error: invalid type in declaration before ';' token
../boost/thread/future.hpp: In function 'boost::future<typename boost::result_of<typename boost::decay<F>::type(typename boost::decay<ArgTypes>::type ...)>::type> boost::async(Executor&, F&&, ArgTypes&& ...)':
../boost/thread/future.hpp:3867: sorry, unimplemented: cannot expand 'typename boost::decay<ArgTypes>::type ...' into a fixed-length argument list
../boost/thread/future.hpp:3867: error: invalid type in declaration before ';' token
../boost/thread/future.hpp:3868: error: 'BF' is not a class type
../boost/thread/future.hpp:3868: error: 'result_type' in class 'BF' does not name a type
../boost/thread/future.hpp:3868: error: invalid type in declaration before ';' token
../boost/thread/future.hpp: In member function 'void boost::detail::shared_state_nullary_task<Rp, Fp>::operator()() [with Rp = int, Fp = int]':
../boost/thread/detail/nullary_function.hpp:52:   instantiated from 'void boost::detail::nullary_function<void()>::impl_type<F>::call() [with F = boost::detail::shared_state_nullary_task<int, int>]'
../libs/thread/test/sync/futures/async/async_executor_pass.cpp:251:   instantiated from here
../boost/thread/future.hpp:3692: error: '((boost::detail::shared_state_nullary_task<int, int>*)this)->boost::detail::shared_state_nullary_task<int, int>::f_' cannot be used as a function

For example ex_with_lock_guard fails to compile with this message:

In file included from ../libs/thread/test/../example/with_lock_guard.cpp:13:
../boost/thread/with_lock_guard.hpp: In instantiation of 'decltype (func((#'template_id_expr' not supported by pp_c_expression#)(boost::with_lock_guard::args)...)) boost::with_lock_guard(Lockable&, Function&&, Args&& ...) [with Lockable = boost::mutex, Function = void (&)(), Args = ]':
../boost/thread/with_lock_guard.hpp:52:   instantiated from here
../boost/thread/with_lock_guard.hpp:56: sorry, unimplemented: mangling template_id_expr

Change History (7)

comment:1 by viboes, 8 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

This is a gcc bug (See http://stackoverflow.com/questions/1989552/gcc-error-with-variadic-templates-sorry-unimplemented-cannot-expand-identi).

I have no time to find a workaround for it. If you could provide a patch I would try to apply it.

comment:2 by viboes, 8 years ago

Hi, could you try this patch?

git diff include/boost/thread/future.hpp
diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp
index 6443ba9..2c235ea 100644
--- a/include/boost/thread/future.hpp
+++ b/include/boost/thread/future.hpp
@@ -3866,7 +3866,9 @@ namespace detail {
     // future<R> async(Executor& ex, F&&, ArgTypes&&...);
     ////////////////////////////////
 
-#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+//#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+#if defined(BOOST_THREAD_PROVIDES_INVOKE) && ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && ! defined(BOOST_NO_CXX11_HDR_TUPLE)
+
 #if defined BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR
 
   template <class Executor, class R, class... ArgTypes>

comment:3 by Niklas Angare <li51ckf02@…>, 8 years ago

The patch got rid of the "cannot expand" errors and so 9-10 more tests pass. I tested it with boost commit b15ca1, thread commit 556bbde.

comment:4 by viboes, 8 years ago

Milestone: To Be DeterminedBoost 1.57.0

Thanks for your quick response. I will close it as soon as this commit is merged to master

https://github.com/boostorg/thread/commit/e93035ce4211375a040cdb61959ecd8d94e3a941

comment:5 by Niklas Angare <li51ckf02@…>, 8 years ago

The other error still remains though ("sorry, unimplemented: mangling template_id_expr"). About ten tests fail because of it.

comment:7 by viboes, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.