summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/copy1.C
blob: 57036d3f0aecc9a6c82bf85b72a38d8e13fde6ef (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
// PR c++/14035
// { dg-do run }

extern "C" void abort();

struct Blob {
  int x, y;
  Blob() { }
  Blob(const Blob &b) { abort (); }
};
struct Blobby : public Blob { };

struct Wooly {
  operator const Blobby & ()
  {
    return myBlobby;
  }
  Blobby myBlobby;
};

void catcher(const Blob &blo)
{ }

int main()
{
  Wooly wooly;
  catcher((const Blob &)wooly);
}