Fortran: default-initialization of derived-type function results [PR98454]
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb79.C
blob1c1ad3e306779b6be639c2512973e595dbc0a3cb
1 // { dg-do assemble  }
2 // { dg-prune-output "note" }
3 // Makes bogus x86 assembly code.
4 #include <iostream>
6 // The VxWorks kernel-mode headers define a macro named "max", which is not
7 // ISO-compliant, but is part of the VxWorks API.
8 #if defined __vxworks && !defined __RTP__
9 #undef max
10 #endif
12 using namespace std;
14 template<class T>
15 T max(T a, T b)
17   return (a > b) ? a : b;
20 // Prototypes (enable one or the other)
21 double max<>(double, double);      // { dg-error "" } bogus code
22 // int max(int, int);
24 int main()
26   int i = 123;
27   double d = 1234.5678;
29   cout.precision(12);
30   cout << max(d, i) << endl;  // { dg-error "" } 
31   cout << max(i, d) << endl;  // { dg-error "" } 
32   return 0;