2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / missed-error2.C
bloba26f456f20a0925fd22ffb18f8f19fd4b6bad6c1
1 // { dg-do assemble  }
2 // GROUPS passed missed-error
3 // missed-error file
4 // From: ndc!don@csvax.cs.caltech.edu (Don Erway)
5 // Date:     Thu, 21 May 92 15:40:45 PDT
6 // Subject:  More on [g++ 2.1 : overloaded function selection incorrect]
7 // Message-ID: <9205212240.AA17934@ndc.com>
9 #include <iostream>
11 // The VxWorks kernel-mode headers define a macro named "max", which is not
12 // ISO-compliant, but is part of the VxWorks API.
13 #if defined __vxworks && !defined __RTP__
14 #undef max
15 #endif
17 inline int max(int a, int b) {return a > b ? a : b;}; // { dg-error "" } candidate
18 inline double max(double a, double b) {return a > b ? a : b;}; // { dg-error "" } candidate
20 int main() {
21    static void foo(int i, int j, double x, double y) ;// { dg-error "" } .*
23    foo(4, -37, 14.39, 14.38);
26 // 971006 we no longer give an error for this since we emit a hard error
27 // about the declaration above
28 static void foo(int i, int j, double x, double y) { 
30    std::cout << "Max(int): " << max(i,j) << " Max(double): " <<
31 max(x,y) << '\n';
32    std::cout << "Max(int, double): " << max(i, y) << '\n';// { dg-error "" }