summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/new4.C
blob: 770a2a26f92a7803de5e364b3d70821e752d8cca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do run  }
// { dg-options "-fcheck-new" }

struct A {
  A(): i(42) { }
  A(int j): i(j) { }
  int i;
};

A* ap = new A (1);
A* ap2 = new A[3];

main ()
{
  if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
    return 1;

  A* ap = new A (1);
  A* ap2 = new A[3];

  if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
    return 1;
}