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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr33589-1.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
struct base { void somemethod() {} };
3
struct derived : public base { };
4
 
5
struct smartpointer
6
{
7
  ~smartpointer() { }
8
  operator derived*() const
9
  {
10
    return 0;
11
  }
12
};
13
typedef void ( derived::* methodptr_type )();
14
methodptr_type getmemberptr()
15
{
16
        return &derived::somemethod;
17
}
18
void somefunction()
19
{
20
        smartpointer pObj;
21
        ( pObj->*getmemberptr() )();
22
}

powered by: WebSVN 2.1.0

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