summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/ref4.C
blob: 5eb97b9884378a17b40f15d8f4630ac1ccc55fe5 (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
// { dg-do assemble  }

// 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 ());
}