aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/operators16.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/operators16.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators16.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators16.C b/gcc/testsuite/g++.old-deja/g++.law/operators16.C
new file mode 100644
index 00000000000..384c4e9c286
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators16.C
@@ -0,0 +1,29 @@
+// GROUPS passed operators
+// copy file
+// From: gfm@mencon.mencon.oz.au (Graham Menhennitt)
+// Date: Thu, 29 Apr 93 20:53:07 EST
+// Subject: 4 bugs in g++ 2.3.3
+// Message-ID: <9304291053.AA00090@mencon>
+
+#include <stdio.h>
+
+int pass = 0;
+struct A {
+ A(void) {}
+ A(const A& a) { ; }
+ A& operator = (const A& a) { pass = 1; }
+};
+
+struct B {
+ B(const A& aa) { B::a = aa; }
+ A a;
+};
+
+main(void)
+{
+ B(A());
+ if (pass)
+ printf ("PASS\n");
+ else
+ printf ("FAIL\n");
+}