Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.law / dtors3.C
blob6f18a3e99be46c5e784c14227a5c476570420819
1 // { dg-do run  }
2 // GROUPS passed destructors
3 // dtor file
4 // Message-Id: <9301242117.AA04053@cs.rice.edu>
5 // From: dougm@cs.rice.edu (Doug Moore)
6 // Subject: 2.3.3: premature dtor of temp?
7 // Date: Sun, 24 Jan 93 15:17:07 CST
9 #include <stdio.h>
10 #include <stdlib.h>
12 int killed = 0;
14 class Foo
16   int a;
17 public:
18   Foo() 
19   :a(0) {;}
20   ~Foo() { killed++;}
21   Foo& operator << (int b)
22   {
23     a += b;
24     if (killed)
25       {
26         printf ("FAIL\n");
27         exit (1);
28       }
29     return *this;
30   }
33 int main()
35   Foo() << 1 << 3 << 5 << 7;
36   printf ("PASS\n");