URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
// { dg-do run }
|
// { dg-do run }
|
// Testcase for tricky synthesized op= in complex inheritance situation.
|
// Testcase for tricky synthesized op= in complex inheritance situation.
|
// This used to test whether the virtual base was copy-assigned only once.
|
// This used to test whether the virtual base was copy-assigned only once.
|
// That feature is not required by ISO C++, so the test now only checks
|
// That feature is not required by ISO C++, so the test now only checks
|
// whether the vbase is assigned at all.
|
// whether the vbase is assigned at all.
|
|
|
int count = 0;
|
int count = 0;
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
class A {
|
class A {
|
public:
|
public:
|
A& operator = (const A&) { count++; return *this; }
|
A& operator = (const A&) { count++; return *this; }
|
};
|
};
|
|
|
class B: virtual private A { };
|
class B: virtual private A { };
|
class C: virtual public A { };
|
class C: virtual public A { };
|
class D: public B, public C { };
|
class D: public B, public C { };
|
|
|
int main()
|
int main()
|
{
|
{
|
D a, b;
|
D a, b;
|
a = b;
|
a = b;
|
printf ("%d\n",count);
|
printf ("%d\n",count);
|
if (count == 0)
|
if (count == 0)
|
return 1;
|
return 1;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.