view run/o/odd_bug_09_A.d @ 1410:be2b20dc0eb4

added bugzilla URIs
author thomask
date Thu, 08 Mar 2007 16:36:19 +0000
parents 092188799a91
children 1ee9a0dd42d9
line wrap: on
line source

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

// @author@	Johan Granberg <lijat.meREM@OVEgmail.com>
// @date@	2006-09-14
// @uri@	news:eeb08s$2p5n$1@digitaldaemon.com
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1034
// @desc@	Incorrect code generation -O2 gdc

module dstress.run.o.odd_bug_09_A;

struct S{
	union{
		void delegate(uint) del;
		void function(uint) fp;
	}
	static S opCall(void function(uint) c,uint i){
		S a;
		a.fp = c;
		return a;
	}
}

S s;

static this(){
	s = S(&foo, 0);
}

void foo(uint i){
}

int main(){
	foo(0);
	if(! s.fp){
		assert(0);
	}
	s.fp(0);

	return 0;
}