summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/copy7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/copy7.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/copy7.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/copy7.C b/gcc/testsuite/g++.old-deja/g++.brendan/copy7.C
new file mode 100644
index 000000000..8fbec3384
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/copy7.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// GROUPS passed copy-ctors
+extern "C" int printf (const char *, ...);
+extern "C" void exit (int);
+
+void die () { printf ("FAIL\n"); exit (1); }
+
+class B {
+public:
+ B() {}
+ B(const B &) { printf ("PASS\n"); exit (0); }
+private:
+ int x;
+};
+
+class A : public B {
+public:
+ A() {}
+
+ A(const B &) { printf ("FAIL\n"); exit (1); }
+};
+
+int
+main()
+{
+ A a;
+ A b(a);
+
+ printf ("FAIL\n");
+ return 1;
+}