| 1 |
// { dg-do run } |
| 2 |
// GROUPS passed arrays |
| 3 |
// array file |
| 4 |
// Message-Id: <[email protected]> |
| 5 |
// From: [email protected] (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 |
} |