Hi there,
I'm experiencing a compiler error in code that tries to assign a Boost.Phoenix function object returned by invoking a phoenix::function with a std::string as one of the bound parameters.
I've reduced my error to the following minimal code:
#include <string>
#include
#include
struct S {
void operator()(std::string, int) const;
};
boost::phoenix::function<S> lazy;
auto func1 = lazy(std::string(), boost::phoenix::placeholders::_1);
auto func2 = func1;
void foo() {
func2 = func1;
}
My compiler version is clang 3.7; the error does not occur with gcc 5.1.
The error also goes away if I change the type of the first argument from std::string to a different type (like int).
The compiler error is shown below. Any ideas as to what is going on? Am I doing something wrong, or did I run into a bug in Phoenix?
Thanks,
Nate
In file included from test.cpp:81:
In file included from /home/nr/dev/dist/boost/include/boost/phoenix/core/argument.hpp:13:
In file included from /home/nr/dev/dist/boost/include/boost/phoenix/core/actor.hpp:25:
In file included from /home/nr/dev/dist/boost/include/boost/proto/make_expr.hpp:100:
In file included from /home/nr/dev/dist/boost/include/boost/proto/detail/make_expr_.hpp:3:
/home/nr/dev/dist/boost/include/boost/proto/detail/preprocessed/make_expr_.hpp:73:88: error: no type named 'type' in
'boost::proto::transformboost::proto::_ ()>, void>::result,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>>, 2>)>'
typedef typename proto_generator::template result::type result_type;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/nr/dev/dist/boost/include/boost/proto/make_expr.hpp:180:34: note: in instantiation of template class 'boost::proto::detail::make_expr_,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>, const
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>, void, void, void,
void, void, void, void, void, void>' requested here
typename detail::make_expr_<
^
/home/nr/dev/dist/boost/include/boost/phoenix/core/actor.hpp:225:36: note: in instantiation of template class 'boost::proto::result_of::make_expr,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>, const
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>, void, void, void,
void, void, void, void, void, void>' requested here
typename proto::result_of::make_expr<
^
/home/nr/dev/dist/boost/include/boost/phoenix/core/actor.hpp:185:12: note: while substituting deduced template arguments into function template 'operator=' [with A0 = const
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>]
struct actor
^
/home/nr/dev/dist/boost/include/boost/proto/matches.hpp:830:44: note: in instantiation of template class 'boost::proto::exprns_::basic_expr,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>>, 2>' requested
here
: Cases::template case_<typename Expr::proto_tag>::template impl
^
/home/nr/dev/dist/boost/include/boost/proto/transform/impl.hpp:238:13: note: in instantiation of template class 'boost::proto::switch_boost::proto::_ ()>::impl,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>>, 2>, int,
boost::proto::envns_::empty_env>' requested here
: PrimitiveTransform::template impl
^
/home/nr/dev/dist/boost/include/boost/proto/transform/impl.hpp:255:9: note: in instantiation of template class 'boost::proto::detail::apply_transform,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>>, 2>)>' requested
here
BOOST_PROTO_TRANSFORM_(PrimitiveTransform, X)
^
/home/nr/dev/dist/boost/include/boost/proto/transform/impl.hpp:194:48: note: expanded from macro 'BOOST_PROTO_TRANSFORM_'
typedef typename boost::proto::detail::apply_transform<Sig>::result_type type; \
^
/home/nr/dev/dist/boost/include/boost/proto/detail/preprocessed/make_expr_.hpp:73:43: note: in instantiation of template class
'boost::proto::transformboost::proto::_ ()>, void>::result,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>>, 2>)>' requested
here
typedef typename proto_generator::template result::type result_type;
^
/home/nr/dev/dist/boost/include/boost/proto/make_expr.hpp:180:34: note: in instantiation of template class 'boost::proto::detail::make_expr_,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>, void, void, void,
void, void, void, void, void, void>' requested here
typename detail::make_expr_<
^
/home/nr/dev/dist/boost/include/boost/phoenix/core/actor.hpp:213:36: note: in instantiation of template class 'boost::proto::result_of::make_expr,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>,
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>, void, void, void,
void, void, void, void, void, void>' requested here
typename proto::result_of::make_expr<
^
test.cpp:96:8: note: while substituting deduced template arguments into function template 'operator=' [with A0 =
boost::phoenix::actor,
boost::proto::exprns_::basic_expr, 0>,
boost::phoenix::actor>, 0>>>, 3>>]
func2 = func1;
^
1 error generated.