OSDN Git Service

PR c++/4872
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / array1.C
1 // GROUPS passed arrays
2 // array file
3 // Message-Id: <9204120353.AA06266@cs.rice.edu>
4 // From: dougm@cs.rice.edu (Doug Moore)
5 // Subject: constructors not called on new'ed array elements
6 // Date: Sat, 11 Apr 92 22:53:35 CDT
7
8 #include <stdio.h>
9
10 int i = 0;
11
12 class foo
13 {
14 private:
15   static foo *array;
16 public:
17   foo()
18     {
19       i++;
20     }
21 };
22
23 foo* foo::array = new foo [5];
24
25 int main()
26 {
27   if (i != 5)
28     { printf ("FAIL\n"); return 1; }
29   else
30     printf ("PASS\n");
31 }