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++.law/] [operators28.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do assemble }
// GROUPS passed operators
#include <sys/types.h>
#include <stdio.h>
class new_test
{
int type;
public:
void* operator new(size_t sz, int count, int type);
};
void* new_test::operator new(size_t sz, int count, int type)
{
void *p;
printf("%d %d %d\n", sz, count, type);
p = new char[sz * count];
((new_test *)p)->type = type;
return p;
}
int main()
{
new_test *test;
int count = 13;
test = new(count, 1) new_test;
}