aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/ref4.C
blob: c3535d0d3e034b3b83ba878ed6b39f7821de0905 (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:

// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 27 Feb 2001 <nathan@codesourcery.com>

// Bug 2117. A conversion op to reference type created a temporary, even
// when bound to another reference.

struct Abstract
{
  virtual void Foo () = 0;
};

struct Proxy
{
  operator Abstract & ();
  Abstract &Convert ();
};

void Baz (Abstract &);

void Foo ()
{
  Proxy proxy;
  
  Baz (proxy);
  Baz (proxy.Convert ());
}