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++/15480] ICE with sizeof(T().f()) as template parameter in function resolution


------- Additional Comments From gianni at mariani dot ws  2004-05-17 03:48 -------

I get this error when removing the templates:

xx6.cpp:43: sorry, unimplemented: call_expr cannot be mangled due to a defect in
the C++ ABI


------------------------------
typedef char MPT_False;
typedef int MPT_True;

template <unsigned w_siz>
struct MPT_IntToType
{
    typedef char    type[ 1 ];
};

struct B
{
    int Function();
};

struct DerivedClass_B : B
{
};

struct FinderM
{

    template <typename w_T>
    static MPT_True finder(
        const w_T *,
        typename MPT_IntToType<
            sizeof(static_cast<w_T *>(0)->Function())
        >::type * = 0
    );

    static MPT_False finder( const B * );

};

bool  value = 
    sizeof( FinderM::finder( static_cast<DerivedClass_B *>(0) ) ) == sizeof(
MPT_True );


------------------------------


-- 


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


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