2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb79.C
blob8d1c94d168ffcb732fecff0e86a2b6c26eddb3b4
1 // { dg-do assemble  }
2 // Makes bogus x86 assembly code.
3 #include <iostream>
5 // The VxWorks kernel-mode headers define a macro named "max", which is not
6 // ISO-compliant, but is part of the VxWorks API.
7 #if defined __vxworks && !defined __RTP__
8 #undef max
9 #endif
11 using namespace std;
13 template<class T>
14 T max(T a, T b)
16   return (a > b) ? a : b;
19 // Prototypes (enable one or the other)
20 double max<>(double, double);      // { dg-error "" } bogus code
21 // int max(int, int);
23 int main()
25   int i = 123;
26   double d = 1234.5678;
28   cout.precision(12);
29   cout << max(d, i) << endl;  // { dg-error "" } 
30   cout << max(i, d) << endl;  // { dg-error "" } 
31   return 0;