| 1 |
// { dg-do run } |
| 2 |
// GROUPS passed constructors |
| 3 |
// ctor file |
| 4 |
// Message-Id: <[email protected]> |
| 5 |
// From: [email protected] |
| 6 |
// Subject: bug with new/delete of multidimensional array |
| 7 |
// Date: Sat, 27 Mar 93 14:04:52 EST |
| 8 |
|
| 9 |
#include <stdio.h> |
| 10 |
#include <stdlib.h> |
| 11 |
|
| 12 |
int construct = 0; |
| 13 |
|
| 14 |
class Element { |
| 15 |
public: |
| 16 |
Element() { construct++; if (construct > 6) {printf ("FAIL\n"); exit(1);}} |
| 17 |
~Element() { } |
| 18 |
}; |
| 19 |
|
| 20 |
typedef Element array[2]; |
| 21 |
|
| 22 |
int main() { |
| 23 |
array *x; |
| 24 |
x = new array[3]; |
| 25 |
delete x; |
| 26 |
printf ("PASS\n"); |
| 27 |
} |