OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [ptrmem10.C] - Rev 801

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)             // { dg-message "note" }
{
  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|could not convert)" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}

struct S
{
  void baz () {}
};

int
main ()
{
  S a;
  bar(&a, &S::baz);
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.