This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15480] ICE with sizeof(T().f()) as template parameter in function resolution
- From: "gianni at mariani dot ws" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2004 03:48:43 -0000
- Subject: [Bug c++/15480] ICE with sizeof(T().f()) as template parameter in function resolution
- References: <20040516212738.15480.gianni@mariani.ws>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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