Debian Codegraph @

gcc/testsuite/g++.dg/other/synth1.C

raw
1 // Copyright (C) 2004 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 17 Dec 2004 <[email protected]>
3
4 // PR 18975: Rejects legal
5 // Origin: Wolfgang Roehrl <[email protected]>
6
7 struct PTR
8 {
9 PTR ();
10 PTR (PTR&);
11 PTR& operator= (PTR&);
12
13 private:
14 PTR (const PTR&);
15 PTR& operator= (const PTR&);
16 };
17
18
19 struct XYZ
20 {
21 XYZ (PTR& p) : ptr(p) {}
22
23 mutable PTR ptr;
24 };
25
26
27 XYZ f1 ();
28
29
30 XYZ f2 (void) { return f1(); }
31 void f3 (XYZ& dst, const XYZ& src) { dst = src; }