2 // Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
5 // Related to bug 91. We'd not preserve constness accessing a member of the
6 // source type in copy ctor and assignment op.
17 { printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
20 { printf ("%s\n", __PRETTY_FUNCTION__); value = 2;}
23 { printf ("%s\n", __PRETTY_FUNCTION__); value = 3; return *this; }
25 A& operator=( const A& )
26 { printf ("%s\n", __PRETTY_FUNCTION__); value = 4; return *this; }
37 printf ("%s\n", __PRETTY_FUNCTION__); value = 5;
42 printf ("%s\n", __PRETTY_FUNCTION__); value = 6;
48 value = 0; printf ("A(cA) : "); A a1(a0); if (value != 2) return 1;
49 value = 0; printf ("A(A ) : "); A a2(a1); if (value != 1) return 2;
52 value = 0; printf ("B(cB) : "); B b1(b0); if (value != 2) return 3;
53 value = 0; printf ("B(B ) : "); B b2(b1); if (value != 2) return 4;
55 value = 0; printf ("A= cA : "); a1 = a0; if (value != 4) return 5;
56 value = 0; printf ("A= A : "); a1 = a2; if (value != 3) return 6;
57 value = 0; printf ("B= cB : "); b1 = b0; if (value != 4) return 7;
58 value = 0; printf ("B= B : "); b1 = b2; if (value != 4) return 8;
60 value = 0; printf ("foo(cB): "); foo(b0.a); if (value != 6) return 9;
61 value = 0; printf ("foo(B ): "); foo(b2.a); if (value != 5) return 10;