2 // GROUPS passed missed-error
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>
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__
17 inline int max(int a, int b) {return a > b ? a : b;}; // { dg-message "note" }
18 // { dg-error "extra ';'" "extra ;" { target *-*-* } .-1 }
19 inline double max(double a, double b) {return a > b ? a : b;}; // { dg-message "note" } candidate
20 // { dg-error "extra ';'" "extra ;" { target *-*-* } .-1 }
23 static void foo(int i, int j, double x, double y) ;// { dg-error "" } .*
25 foo(4, -37, 14.39, 14.38);
28 // 971006 we no longer give an error for this since we emit a hard error
29 // about the declaration above
30 static void foo(int i, int j, double x, double y) {
32 std::cout << "Max(int): " << max(i,j) << " Max(double): " <<
34 std::cout << "Max(int, double): " << max(i, y) << '\n';// { dg-error "" }