URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [delete5.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do assemble }
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Apr 1999 <nathan@acm.org>
typedef __SIZE_TYPE__ size_t;
struct X
{
int i;
X():i(){}
void *operator new(size_t)
{
return 0; // { dg-warning "" } cannot return NULL
}
void *operator new[](size_t)
{
return 0; // { dg-warning "" } cannot return NULL
}
};
struct Y
{
int i;
Y():i(){}
void *operator new(size_t) throw()
{
return 0; // ok
}
void *operator new[](size_t) throw()
{
return 0; // ok
}
};
int main()
{
Y *yp = new Y;
return yp != 0;
}