view run/new_13.d @ 528:9e0847cf535a

pre DMD-0.123 review Walter <walter@digitalmars.com> 2005-05-11 mail:00a301c5567d$489cbf20$0200a8c0@colossus
author thomask
date Thu, 12 May 2005 11:13:04 +0000
parents e555e1460d7e
children b3da1b510a19
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

module dstress.run.new_13;

extern(C) void* malloc(size_t size);

int counter;

union MyUnion{
	int x;

	new(size_t size){
		counter++;
		return malloc(size);
	}
}

int main(){
	assert(counter==0);
	MyUnion* m = new MyUnion;
	m.x=1;
	assert(counter==1);
	return 0;
}