OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [missed-error2.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { 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>
8
 
9
#include 
10
 
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
16
 
17
inline int max(int a, int b) {return a > b ? a : b;}; // { dg-message "note" }
18
 // { dg-error "extra ';'" "extra ;" { target *-*-* } 17 }
19
inline double max(double a, double b) {return a > b ? a : b;}; // { dg-message "note" } candidate
20
 // { dg-error "extra ';'" "extra ;" { target *-*-* } 19 }
21
 
22
int main() {
23
   static void foo(int i, int j, double x, double y) ;// { dg-error "" } .*
24
 
25
   foo(4, -37, 14.39, 14.38);
26
}
27
 
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) {
31
 
32
   std::cout << "Max(int): " << max(i,j) << " Max(double): " <<
33
max(x,y) << '\n';
34
   std::cout << "Max(int, double): " << max(i, y) << '\n';// { dg-error "" }
35
   // { dg-message "candidate" "candidate note" { target *-*-* } 34 }
36
}
37
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.