view run/o/odd_bug_09_A.d @ 1488:1ee9a0dd42d9

changed nntp: URLs to http: URLs
author thomask
date Mon, 09 Apr 2007 12:29:50 +0000
parents be2b20dc0eb4
children
line wrap: on
line source

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

// @author@	Johan Granberg <lijat.meREM@OVEgmail.com>
// @date@	2006-09-14
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=8389
// @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;
}