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] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// { dg-options "-fms-extensions" }
3
// Test that an object-dependent reference to a member function can be
4
// used to produce a pointer to member function, as in VC++.
5
// Contributed by Jason Merrill 
6
 
7
struct A
8
{
9
  int  f(int a) { return 0; }
10
  void f(int a, int b) { }
11
};
12
 
13
typedef int  (A::* pmf1)(int);
14
typedef void (A::* pmf2)(int, int);
15
 
16
int main()
17
{
18
  A a;
19
  pmf1 fn1;
20
  pmf2 fn2;
21
 
22
  fn1 = a.f;
23
  fn1 = (pmf1)a.f;
24
  fn2 = (pmf2)a.f;
25
}

powered by: WebSVN 2.1.0

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