4 // Copyright (C) 2003 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 30 Jul 2003 <nathan@codesourcery.com>
7 // compound exprs were causing additional temporaries.
9 extern "C" int printf (char const *, ...);
10 extern "C" void abort ();
13 static unsigned order[] =
19 static unsigned point;
21 static void Check (unsigned t, unsigned i, void const *ptr, char const *name)
23 printf ("%d %d %p %s\n", t, i, ptr, name);
25 if (order[point++] != i + t)
30 template <int I> struct A
32 A () { Check (0, I, this, __PRETTY_FUNCTION__); }
33 ~A () { Check (100, I, this, __PRETTY_FUNCTION__); }
34 A (A const &) { Check (200, I, this, __PRETTY_FUNCTION__); }
35 A &operator= (A const &) { Check (300, I, this, __PRETTY_FUNCTION__); }
36 void Foo () const { Check (400, I, this, __PRETTY_FUNCTION__); }
39 template <int I> void Foo (A<I> a)
41 Check (500, I, &a, __PRETTY_FUNCTION__);
46 Foo ((A<1> (), A<2> ()));
47 Check (0, 0, 0, "end");