aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/cvt5.C
blob: d244b4f522512b3e156e3a883946ba8c97620442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Build don't link: 
// GROUPS passed conversions
// cvt file
// Message-Id: <1992Jul31.142856.10082@ericsson.se>
// From: jonas@ericsson.se (Jonas Nygren)
// Subject: g++ bug
// Date: Fri, 31 Jul 1992 14:28:56 GMT

class A {};
class B : public A {};

B b;

class R{
public:
  R() {}
  operator B&() { return b; }
};

void f(A&) {}

main(){
  R r;

  f(r); // problem to cast to B& and then to A&
}