FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900321_02.C
blobe54a02d80b69e228e54b4167cd1e19310afea4fc
1 // g++ 1.37.1 bug 900321_02
3 // The following program exits with a nonzero status because the constructor
4 // is not called 3 times as it should be.  This program exits with a zero
5 // status when compiled with cfront 2.0.
7 // Cfront 2.0 passes this test.
9 // keywords: arrays, initialization, default constructor, operator new
11 int call_count = 0;
13 struct struct0 {
14   struct0 ();
17 struct0::struct0 () { call_count++; }
19 typedef struct0 array[3];       // known dimension
21 int test ()
23   new array;
24   return (call_count != 3);
27 int main () { return test (); }