URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [call1.C] - Rev 305
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// Test that various calls to non-functions work.
void f () { }
typedef void (*fptr)();
typedef void (&fref)();
fptr p = f;
fref r = f;
const fptr &pr = p;
struct A {
fptr p;
A (fptr n): p(n) { }
operator fptr () { return p; }
};
struct B {
fref r;
B (fptr n): r(*n) { }
operator const fref () { return r; }
};
struct C {
const fptr pr;
C (fptr n): pr(n) { }
operator const fptr& () { return pr; }
};
int main ()
{
f();
p();
r();
pr();
A a (f);
a();
a.p();
B b (f);
b();
b.r();
C c (f);
c();
c.pr();
}
Go to most recent revision | Compare with Previous | Blame | View Log