aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/operators11.C
blob: 16eccea6e40c8a6b23b9587b67c0741fb98f3b25 (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
29
30
31
32
33
34
35
36
// Build don't link: 
// GROUPS passed operators
// opr-eq file
// Message-Id: <CCJrut.9M7@csc.ti.com>
// From: rowlands@hc.ti.com (Jon Rowlands)
// Subject: g++ 2.4.5: assignment operator in base class
// Date: Mon, 30 Aug 1993 00:54:29 GMT

class B {
public:
	B &	operator = (B);	// delete this line and problem goes away
};

class D : public B {
public:
	D();
	D(int);
	D(B);
};

int
main() {
	B	b;
	D	d;

	d = d;

	d = 0;	// t.cxx:20: assignment not defined for type `D'
	d = D(0);

	d = b;	// t.cxx:23: assignment not defined for type `D'
	d = D(b);

	return(0);
}