diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/expr/copy1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/expr/copy1.C | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/copy1.C b/gcc/testsuite/g++.dg/expr/copy1.C new file mode 100644 index 000000000..57036d3f0 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/copy1.C @@ -0,0 +1,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); +} |