OSDN Git Service

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