Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.jason / new.C
blobd5260ce8eca4d622ee9b54a84bfdfa88fbdf65cf
1 // { dg-do assemble  }
2 // Bug: new doesn't make sure that the count is an integral value.
4 #include <new>
5 extern "C" int printf (const char *, ...);
6 extern "C" void *malloc (size_t);
7 size_t s;
9 void * operator new (size_t siz) throw (std::bad_alloc) {
10   if (s == 0)
11     s = siz;
12   else
13     s = (s != siz);
14   return malloc (siz);
17 int main()
19   s = 0;
21   float f = 3;
22   int* b1 = new int[(int)f];
23   int* b2 = new int[f];         // { dg-error "" } new requires integral size
25   return s;