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: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 May 2004 21:39:07 -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 pinskia at gcc dot gnu dot org 2004-05-16 21:39 -------
Confirmed.
Here is a simplied example (it might be turned into invalid though):
template <unsigned int w_siz>
struct MPT_IntToType
{
typedef char type;
};
template <typename w_D>
struct MPT_Finder_Member
{
template <typename w_T>
static int finder(
const w_T *,
typename MPT_IntToType<
sizeof(w_T().Function())
>::type * = 0
);
static int finder( const w_D * );
};
template <typename w_D >
struct MPT_ContainsFuncMember
{
struct DerivedClass : w_D{};
typedef DerivedClass * DerivedClassp;
enum {
value = (
sizeof( MPT_Finder_Member<w_D>::finder( DerivedClassp() ) )
== sizeof( int)
)
};
};
struct A{};
int t = MPT_ContainsFuncMember<A>::value;
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-05-16 21:39:06
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15480