summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/vecdel.C
blob: 6c6990933a905be94b83958a3cd33cf3025e9a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do run  }
__SIZE_TYPE__ newsize = 0;
__SIZE_TYPE__ delsize = 0;

struct A {
  int i;
  void * operator new [] (__SIZE_TYPE__ i)
    { newsize = i; return ::operator new [](i); }
  void operator delete [] (void *p, __SIZE_TYPE__ i)
    { delsize = i; ::operator delete [](p); }
};

int main()
{
  A* ap = new A [2];
  delete [] ap;
  if (!newsize || newsize != delsize)
    return 1;
  return 0;
}