OSDN Git Service

PR c++/4872
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / missed-error2.C
1 // Build don't link: 
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>
8
9 #include <iostream>
10
11 inline int max(int a, int b) {return a > b ? a : b;}; // ERROR - candidate
12 inline double max(double a, double b) {return a > b ? a : b;}; // ERROR - candidate
13
14 int main() {
15    static void foo(int i, int j, double x, double y) ;// ERROR - .*
16
17    foo(4, -37, 14.39, 14.38);
18 }
19
20 // 971006 we no longer give an error for this since we emit a hard error
21 // about the declaration above
22 static void foo(int i, int j, double x, double y) { 
23
24    std::cout << "Max(int): " << max(i,j) << " Max(double): " <<
25 max(x,y) << '\n';
26    std::cout << "Max(int, double): " << max(i, y) << '\n';// ERROR - 
27 }
28