[mpl] aux_::template_arity subtly broken on gcc-4.5

First, I freely acknowledge that I have been relying on an implementation detail of MPL, and I will spend an appropriate amount of time doing penance in programmer purgatory after I die. That said ... Xpressive is broken on gcc-4.5 because mpl::aux_::template_arity is causing instantiations on that compiler that it shouldn't. Consider the following program that compiles on gcc-4.4 but not gcc-4.5. #include <boost/mpl/aux_/template_arity.hpp> #include <boost/mpl/aux_/lambda_arity_param.hpp> template<class A> struct T : A::x {}; template< class T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM( int Arity = boost::mpl::aux::template_arity<T>::value )
struct S {}; template<template<class A> class P, class X> struct S<P<X> BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(1)> {}; int main() { S<T<int> > s0; } The error I get is: bug4109.cpp: In instantiation of ‘T<int>’: ../../../boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:85:5: instantiated from ‘const int boost::mpl::aux::template_arity_impl<T<int>, 1>::value’ ../../../boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:93:5: instantiated from ‘const int boost::mpl::aux::template_arity<T<int>
::value’ ../../../boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98:30: instantiated from ‘boost::mpl::aux::template_arity<T<int> >’ bug4109.cpp:23:14: instantiated from here bug4109.cpp:6:3: error: ‘int’ is not a class, struct, or union type
Any chance of a fix? -- Eric Niebler BoostPro Computing http://www.boostpro.com

First, I freely acknowledge that I have been relying on an implementation detail of MPL, and I will spend an appropriate amount of time doing penance in programmer purgatory after I die. That said ...
Any chance of a fix?
There 's a trac with a patch already available. I don't know if it's to be in 1.43

On 4/19/2010 9:59 PM, Joel.Falcou@lri.fr wrote:
First, I freely acknowledge that I have been relying on an implementation detail of MPL, and I will spend an appropriate amount of time doing penance in programmer purgatory after I die. That said ...
Any chance of a fix?
There 's a trac with a patch already available. I don't know if it's to be in 1.43
Are you referring to https://svn.boost.org/trac/boost/ticket/2297 from 20 months ago? -- Eric Niebler BoostPro Computing http://www.boostpro.com

Eric Niebler wrote:
Are you referring to https://svn.boost.org/trac/boost/ticket/2297 from 20 months ago?
I'm refering to : https://svn.boost.org/trac/boost/ticket/4061 I hadn't the trac at hand so sorry for the lack of details
participants (3)
-
Eric Niebler
-
Joel Falcou
-
Joel.Falcou@lri.fr