URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [virtual5.C] - Rev 717
Go to most recent revision | Compare with Previous | Blame | View Log
// Test that a synthesized op= can override one from a base.
// { dg-do run }
struct B;
struct A
{
virtual B& operator=(const B&);
};
struct B: A
{
B(int i): i(i) { }
int i;
// implicitly-declared op=
};
B& A::operator=(const B& b) { return static_cast<B&>(*this); }
int main()
{
B b1 (123);
B b2 (0);
A& ar = b1;
ar = b2;
return b1.i;
}
Go to most recent revision | Compare with Previous | Blame | View Log