4 extern "C" int printf (char const *, ...);
5 extern "C" void abort ();
7 // There are two alternate legal renderings.
8 static unsigned int alt1[] = { 11, 10, 21, 110, 111, 121 };
9 static unsigned int alt2[] = { 10, 11, 21, 111, 110, 121 };
11 static unsigned int pointer = 0;
12 static unsigned int *which;
14 static void Check (unsigned t, unsigned i, void const *ptr, char const *name)
16 printf ("%d %d %p %s\n", t, i, ptr, name);
18 if (pointer > sizeof(alt1)/sizeof(alt1[0]))
24 else if (t + i == alt2[0])
29 else if (t + i != which[pointer])
38 A (int i) : I(i) { Check (0, I, this, __PRETTY_FUNCTION__); }
39 ~A () { Check (100, I, this, __PRETTY_FUNCTION__); }
40 A (A const &a) : I(a.I) { Check (200, I, this, __PRETTY_FUNCTION__); }
41 A &operator= (A const &a)
42 { I = a.I; Check (300, I, this, __PRETTY_FUNCTION__); return *this; }
43 void Foo () const { Check (400, I, this, __PRETTY_FUNCTION__); }
44 A operator+ (A const &a) const
45 { return A(I + a.I); }