id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3021,proto::extends compilation error with function type on gcc-3.4.5,François Barel ,Eric Niebler,"The following test case has been simplified from Spirit's actions.cpp test case. This does not compile with gcc-3.4.5 or 3.4.6: {{{ #include using namespace boost::proto; void func() {} struct my_tag {}; struct my_terminal : extends< terminal::type, my_terminal > {}; my_terminal const foo = my_terminal(); int main() { foo[&func]; // OK foo[func]; // fails with gcc-3.4.5 and 3.4.6 return 0; } }}} with this error: {{{ boost/proto/extends.hpp: In member function '...': test.cpp:15: instantiated from here boost/proto/extends.hpp:505: error: call of overloaded `as_child(void (&)())' is ambiguous boost/proto/traits.hpp:2050: note: candidates are: typename result_of::as_child::type as_child(T&, typename disable_if, detail::undefined>::type*) [with Domain = default_domain, T = void ()()] boost/proto/traits.hpp:2059: note: typename result_of::as_child::type as_child(const T&) [with Domain = default_domain, T = void ()()] }}} (but it works fine with gcc-4.1.2 and later). [[BR]] I think it is because these versions of gcc do not implement DR-214 resolution ([http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#214 Partial ordering of function templates], see [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19203 gcc bug #19203]), so: * since the disable_if on as_child does not disable the non-const overload (since the function type is not const), * gcc reports the 2 overloads as ambiguous instead of choosing the const one. A solution would probably be to also disable the non-const as_child overload if the argument type is a function? Thanks,[[BR]] François",Bugs,closed,Boost 1.40.0,proto,Boost Development Trunk,Problem,fixed,proto extends function gcc DR214,