This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33808] internal compiler error: in write_type, at cp/mangle.c:1651



------- Comment #5 from brakiozor at caramail dot com  2007-10-19 10:06 -------
yes, one of the way is to pass by an intermediate template type...
(I found it on the web)
but the compiler error could(and should) be fixed

#define TPL_TYPEOF_MUL(A,B) typename typeof_mul<A,B>::type
#define TYPEOF_MUL(A,B) typeof_mul<A,B>::type

template <typename A, typename B>
struct typeof_mul
{
    typedef typeof(A()*B()) type;
};

template <class Tx, class Ty>
Y<TPL_TYPEOF_MUL(Tx,Ty)> operator *(X<Tx>& x, const Ty& y)
{
    Y<TPL_TYPEOF_MUL(Tx,Ty)> res(x);
    //res *= y;
    return res;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33808


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]