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 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


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