1 // { dg-do run  }
2 // GROUPS passed constructors
3 // ctor file
4 // Message-Id: <9303270404.28207@munta.cs.mu.OZ.AU>
5 // From: fjh@cs.mu.oz.au
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:
Element()16     Element() { construct++; if (construct > 6) {printf ("FAIL\n"); exit(1);}}
~Element()17     ~Element() { }
18 };
19 
20 typedef Element array[2];
21 
main()22 int main() {
23     array *x;
24     x = new array[3];
25     delete x;
26     printf ("PASS\n");
27 }
28