This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53009] pointer to static member function of template class is âinvalidâ as a template argument of another template class
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 16 Apr 2012 16:53:46 +0000
- Subject: [Bug c++/53009] pointer to static member function of template class is âinvalidâ as a template argument of another template class
- Auto-submitted: auto-generated
- References: <bug-53009-4@http.gcc.gnu.org/bugzilla/>
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();
}