8sa1-gcc/gcc/testsuite/g++.old-deja/g++.bob/delete1.C
Nathan Sidwell 7f477e818a cp-tree.h (TYPE_NOTHROW_P): New macro.
* cp-tree.h (TYPE_NOTHROW_P): New macro.
	* decl2.c (delete_sanity): Warn on deleting void *.
	* init.c (build_new_1): Use TYPE_NOTHROW_P.
	* typeck.c (c_expand_return): cp_pedwarn on returning NULL from
	throwing operator new.

From-SVN: r26692
1999-04-29 08:33:55 +00:00

23 lines
334 B
C

// prms-id: 7330
#include <stddef.h>
int size = 0;
struct X {
int x;
void *operator new[](size_t sz) throw() {
size = sz;
return 0;
}
void operator delete[] (void *vp) { ::operator delete(vp); }
};
int main()
{
X (*px) [10];
px = new X[5][10];
delete [] px;
return 0;
}