1 // { dg-do assemble } 2 3 // Copyright (C) 2001 Free Software Foundation, Inc. 4 // Contributed by Nathan Sidwell 27 Feb 2001 <nathan@codesourcery.com> 5 6 // Bug 2117. A conversion op to reference type created a temporary, even 7 // when bound to another reference. 8 9 struct Abstract 10 { 11 virtual void Foo () = 0; 12 }; 13 14 struct Proxy 15 { 16 operator Abstract & (); 17 Abstract &Convert (); 18 }; 19 20 void Baz (Abstract &); 21 Foo()22void Foo () 23 { 24 Proxy proxy; 25 26 Baz (proxy); 27 Baz (proxy.Convert ()); 28 } 29