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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [overload12.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// Origin: Neil Booth  from bug #27.
3
 
4
struct A{};
5
 
6
struct B:A{};
7
 
8
struct C:B{};
9
 
10
struct CX
11
{
12
  C  c;
13
 
14
  operator C&(){return c;}
15
};
16
 
17
// viable functions for call below
18
void f(A&);
19
void f(B&);
20
 
21
int main()
22
{
23
  CX cx;
24
  C  c;
25
 
26
  f(c);   // the standard conversion to B& is better than to A&
27
 
28
  f(cx);  // after user defined conversion to C&
29
  // the standard conversion to B& is better than to A&
30
}

powered by: WebSVN 2.1.0

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