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++/53009] pointer to static member function of template class is âinvalidâ as a template argument of another template class


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-16
     Ever Confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-16 16:53:46 UTC ---
reduced:

template<typename T, T> class function_proxy;

template<typename Return, typename Obj, Return(*func)(Obj)>
struct function_proxy<Return(*)(Obj), func>
{
    static void wrapper(){ }
};

template<typename CT, CT> class member_helper;

template<typename Class, void(Class::*fun)()>
struct member_helper<void(Class::*)(), fun>
{
    static void as_free(Class& obj){ }

    static void worker(){
        //ERROR HERE: template argument 2 is invalid. Not very helpful message.
        (void) function_proxy<decltype(&as_free), &as_free>::wrapper;
    }
};

struct Test
{
    void test(){ }
};

int main()
{
    //does not work
    member_helper<decltype(&Test::test), &Test::test>::worker();
}


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