OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [addrfunc4.C] - Rev 338

Compare with Previous | Blame | View Log

// { dg-do run  }
// { dg-options "-fms-extensions" }
// Test that an object-dependent reference to a member function can be
// used to produce a pointer to member function, as in VC++.
// Contributed by Jason Merrill <jason@cygnus.com>

struct A
{
  int  f(int a) { return 0; }
  void f(int a, int b) { }
};

typedef int  (A::* pmf1)(int);
typedef void (A::* pmf2)(int, int);

int main()
{
  A a;
  pmf1 fn1;
  pmf2 fn2;

  fn1 = a.f; 
  fn1 = (pmf1)a.f;
  fn2 = (pmf2)a.f;
}

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.