2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / operators16.C
blob820e4708347c67b70829855cb05df470379f25b4
1 // { dg-do run  }
2 // GROUPS passed operators
3 // copy file
4 // From: gfm@mencon.mencon.oz.au (Graham Menhennitt)
5 // Date:     Thu, 29 Apr 93 20:53:07 EST
6 // Subject:  4 bugs in g++ 2.3.3
7 // Message-ID: <9304291053.AA00090@mencon>
9 #include <stdio.h>
11 int pass = 0;
12 struct A {
13         A(void) {}
14         A(const A& a) { ; }
15         A& operator = (const A& a) { pass = 1; return *this; }
18 struct B {
19         B(const A& aa) { B::a = aa; }
20         A a;
23 int main(void)
25         B b = A();
26         if (pass)
27                 printf ("PASS\n");
28         else
29                 { printf ("FAIL\n"); return 1; }