URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-fms-extensions" }
|
// { dg-options "-fms-extensions" }
|
// Test that an object-dependent reference to a member function can be
|
// Test that an object-dependent reference to a member function can be
|
// used to produce a pointer to member function, as in VC++.
|
// used to produce a pointer to member function, as in VC++.
|
// Contributed by Jason Merrill
|
// Contributed by Jason Merrill
|
|
|
struct A
|
struct A
|
{
|
{
|
int f(int a) { return 0; }
|
int f(int a) { return 0; }
|
void f(int a, int b) { }
|
void f(int a, int b) { }
|
};
|
};
|
|
|
typedef int (A::* pmf1)(int);
|
typedef int (A::* pmf1)(int);
|
typedef void (A::* pmf2)(int, int);
|
typedef void (A::* pmf2)(int, int);
|
|
|
int main()
|
int main()
|
{
|
{
|
A a;
|
A a;
|
pmf1 fn1;
|
pmf1 fn1;
|
pmf2 fn2;
|
pmf2 fn2;
|
|
|
fn1 = a.f;
|
fn1 = a.f;
|
fn1 = (pmf1)a.f;
|
fn1 = (pmf1)a.f;
|
fn2 = (pmf2)a.f;
|
fn2 = (pmf2)a.f;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.