2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / t16.C
blobe865bdf3d11619c3a9add34d4fbda433a764ffb7
1 // { dg-do run  }
2 extern "C" int printf (const char *, ...);
3 template <class T> T max (const T&x, const T&y)
5   return (x>y)?x:y;
7 int min (const float&, const float&);
8 int min (const int& i1, const int& i2) {
9   return (i1 < i2) ? i1 : i2;
12 class complex
14   double re, im;
15  public:
16   complex (double r, double i=0) { re = r; im = i; }
17   friend int operator > (const complex& x, const complex &y) { return 0; }
18   void print () { }
21 int main ()
23   complex c1 (1, 0);
24   complex c2 (2, 0);
26   int j = max (1, 37);
27   complex m1 = max (c1, c2);
28   m1.print ();
29   printf ("j=%d\n", j);
30   return 0;