1 // Copyright (C) 2004 Free Software Foundation, Inc. 2 // Contributed by Nathan Sidwell 17 Dec 2004 <nathan@codesourcery.com> 3 4 // PR 18975: Rejects legal 5 // Origin: Wolfgang Roehrl <wolfgang.roehrl@de.gi-de.com> 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 { XYZXYZ21 XYZ (PTR& p) : ptr(p) {} 22 23 mutable PTR ptr; 24 }; 25 26 27 XYZ f1 (); 28 29 f2(void)30XYZ f2 (void) { return f1(); } f3(XYZ & dst,const XYZ & src)31void f3 (XYZ& dst, const XYZ& src) { dst = src; } 32