Opened 10 years ago
Closed 9 years ago
#7513 closed Bugs (fixed)
fusion::convert() tries to call convert_impl::call but there isn't
| Reported by: | Owned by: | Joel de Guzman | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | fusion |
| Version: | Boost Development Trunk | Severity: | Problem |
| Keywords: | convert | Cc: | phantall+boost@… |
Description
fusion::convert() tries to call convert_impl::call but there isn't. Is seems that mistake of convert_impl::apply<seq>::call and patch is here.
diff --git a/boost/fusion/sequence/convert.hpp b/boost/fusion/sequence/convert.hpp
index 5264810..e7a2e38 100644
--- a/boost/fusion/sequence/convert.hpp
+++ b/boost/fusion/sequence/convert.hpp
@@ -20,11 +20,11 @@ namespace boost { namespace fusion
template <typename Tag, typename Sequence>
struct convert
{
- typedef typename extension::convert_impl<Tag> gen;
-
typedef typename
- gen::template apply<Sequence>::type
- type;
+ extension::convert_impl<Tag>::template apply<Sequence>
+ gen;
+
+ typedef typename gen::type type;
};
}
Change History (5)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
I tried with gcc 4.8,4.7,4.6 and clang 3.2.
Simple testcase is here.
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/container/list.hpp>
#include <boost/fusion/sequence/convert.hpp>
int main()
{
boost::fusion::vector<int> v(0);
boost::fusion::convert<boost::fusion::cons_tag>(v);
}
compiler outputs:
$ g++-4.8.0 -fmax-errors=1 hoge.cpp
In file included from hoge.cpp:3:0:
/usr/local/include/boost/fusion/sequence/convert.hpp: In instantiation of 'typename boost::fusion::result_of::convert<Tag, Sequence>::type boost::fusion::convert(Sequence&) [with Tag = boost::fusion::cons_tag; Sequence = boost::fusion::vector<int>; typename boost::fusion::result_of::convert<Tag, Sequence>::type = boost::fusion::cons<int, boost::fusion::nil>]':
hoge.cpp:8:54: required from here
/usr/local/include/boost/fusion/sequence/convert.hpp:36:29: error: 'call' is not a member of 'gen {aka boost::fusion::extension::convert_impl<boost::fusion::cons_tag>}'
return gen::call(seq);
^
compilation terminated due to -fmax-errors=1.
$ g++-4.7.3 -fmax-errors=1 hoge.cpp
In file included from hoge.cpp:3:0:
/usr/local/include/boost/fusion/sequence/convert.hpp: In instantiation of 'typename boost::fusion::result_of::convert<Tag, Sequence>::type boost::fusion::convert(Sequence&) [with Tag = boost::fusion::cons_tag; Sequence = boost::fusion::vector<int>; typename boost::fusion::result_of::convert<Tag, Sequence>::type = boost::fusion::cons<int, boost::fusion::nil>]':
hoge.cpp:8:54: required from here
/usr/local/include/boost/fusion/sequence/convert.hpp:36:29: error: 'call' is not a member of 'gen {aka boost::fusion::extension::convert_impl<boost::fusion::cons_tag>}'
compilation terminated due to -fmax-errors=1.
$ g++-4.6 -fmax-errors=1 hoge.cpp
In file included from hoge.cpp:3:0:
/usr/local/include/boost/fusion/sequence/convert.hpp: In function ‘typename boost::fusion::result_of::convert<Tag, Sequence>::type boost::fusion::convert(Sequence&) [with Tag = boost::fusion::cons_tag, Sequence = boost::fusion::vector<int>, typename boost::fusion::result_of::convert<Tag, Sequence>::type = boost::fusion::cons<int, boost::fusion::nil>]’:
hoge.cpp:8:54: instantiated from here
/usr/local/include/boost/fusion/sequence/convert.hpp:36:29: error: ‘call’ is not a member of ‘gen {aka boost::fusion::extension::convert_impl<boost::fusion::cons_tag>}’
compilation terminated due to -fmax-errors=1.
$ clang++ hoge.cpp
In file included from hoge.cpp:3:
/usr/local/include/boost/fusion/sequence/convert.hpp:36:21: error: no member named 'call' in 'boost::fusion::extension::convert_impl<boost::fusion::cons_tag>'
return gen::call(seq);
~~~~~^
hoge.cpp:8:5: note: in instantiation of function template specialization 'boost::fusion::convert<boost::fusion::cons_tag, boost::fusion::vector<int, boost::fusion::void_,
boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_,
boost::fusion::void_> >' requested here
boost::fusion::convert<boost::fusion::cons_tag>(v);
^
1 error generated.
comment:3 by , 9 years ago
| Cc: | added |
|---|
I can reproduce this with Solaris Studio 12.3 (with all 3 STL implementations), gcc 4.4.6, and clang version 3.2.
comment:4 by , 9 years ago
... and I can confirm that the suggested fix resolves the problem for all 3 compilers.
Note:
See TracTickets
for help on using tickets.

I don't see any problem with the original code. Which compiler? Do you have a test case that exhibits this problem?