Problem with MPL/GIL dynamic_image example on gcc-4.1.1

Hi, GCC-4.1.1 gives me the attached error message while compiling dynamic_image. It boils down to: dynamic_image.cpp:14: instantiated from here boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85: error: call of overloaded 'arity_helper( aux::type_wrapper< .... >,aux::arity_tag<1>)' is ambiguous boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:30: note: candidates are: char (&aux::arity_helper(...))[1] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2] Is this a known mpl<->gcc-4.1.1 issue? Furthermore there are some odd warnings, and I am not sure what to think about these. The code there looks a bit fishy. I tried the example with gcc-3.4.4, gcc-4.2.0-alpha20060902 and gcc-4.3.0-alpha20061111. It compiled there, but the warning remained in the gcc-4 series. Regards Andreas Pokorny

Andreas Pokorny <andreas.pokorny@gmx.de> writes:
Hi, GCC-4.1.1 gives me the attached error message while compiling dynamic_image.
It boils down to:
dynamic_image.cpp:14: instantiated from here boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85: error: call of overloaded 'arity_helper( aux::type_wrapper< .... >,aux::arity_tag<1>)' is ambiguous boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:30: note: candidates are: char (&aux::arity_helper(...))[1] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2]
Is this a known mpl<->gcc-4.1.1 issue?
Looks like a clear GCC-4.1.1 bug to me. The error message says the overload on line 37 is ambiguous with itself! That said, if you're trying to use MPL lambda expressions with templates that have 6 or more arguments, I would expect an error here (if a more intelligible one). -- Dave Abrahams Boost Consulting www.boost-consulting.com

Andreas Pokorny writes:
GCC-4.1.1 gives me the attached error message while compiling dynamic_image.
It boils down to:
dynamic_image.cpp:14: instantiated from here boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85: error: call of overloaded 'arity_helper( aux::type_wrapper< .... >,aux::arity_tag<1>)' is ambiguous boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:30: note: candidates are: char (&aux::arity_helper(...))[1] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2] boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:37: note: char (&aux::arity_helper(::aux::type_wrapper<F<T1> >,aux::arity_tag<1>))[2]
Is this a known mpl<->gcc-4.1.1 issue?
AFAICT this is another side of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28088. -- Aleksey Gurtovoy MetaCommunications Engineering

Andreas Pokorny wrote:
GCC-4.1.1 gives me the attached error message while compiling dynamic_image <...skipped...>
I looked into it and found a workaround. The next version of GIL will compile on gcc-4.1.1. If you need a fix in the meantime, the fix is use MPL placeholder expressions. Search for "struct apply" and replace code like this: template <typename ImageViewTypes> struct get_const_views_from_views { private: struct get_const_t { template <typename T> struct apply { typedef typename T::const_t type; }; }; public: typedef typename boost::mpl::transform<ImageViewTypes, get_const_t>::type type; }; With code like this: template <typename ImageViewTypes> struct get_const_views_from_views { private: template <typename T> struct get_const_t { typedef typename T::const_t type; }; public: typedef typename boost::mpl::transform<ImageViewTypes, get_const_t<boost::mpl::_1> >::type type; }; Lubomir
participants (4)
-
Aleksey Gurtovoy
-
Andreas Pokorny
-
David Abrahams
-
Lubomir Bourdev