URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [other/] [ptrmem10.C] - Rev 320
Go to most recent revision | Compare with Previous | Blame | View Log
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/37093
template <class C, void (C::*M) ()>
static
void foo(void *obj)
{
C *p = static_cast<C*>(obj);
(p->*M)();
}
template <class C>
static void
bar(C *c, void (C::*m) ())
{
foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun)" }
}
struct S
{
void baz () {}
};
int
main ()
{
S a;
bar(&a, &S::baz);
}
Go to most recent revision | Compare with Previous | Blame | View Log