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.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [ref10.C] - Rev 384
Compare with Previous | Blame | View Log
// { dg-do run }
// Test that conversion from D* to B*& works properly.
extern "C" int printf (const char *, ...);
struct V {
int a;
};
struct B: virtual V {
int b;
};
struct D: B {
int c;
};
V* gp = 0;
void foo(V * const &r) {
gp = r;
}
int bar(V *r) {
return (r != gp);
}
int main() {
D *p = new D;
foo(p);
return bar(p);
}