[Issue 8982] Assertion failure: '0' on line 353 in file 'ctfeexpr.c'

2012-11-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8982



--- Comment #1 from Don clugd...@yahoo.com.au 2012-11-12 00:58:43 PST ---
Somewhat reduced test case:

template Bug8982(func...)
{
static if (is(typeof(func[0]) PT == __parameters))
{
enum Bug8982 = ((PT[0..1] args) = args[0])();
}
}

struct V8982 {
float x;
}

int func(ref const V8982 v = V8982(1) ){
return 1;
}

pragma(msg, Bug8982!func);

The error occurs while evaluating the default argument. The resulting ErrorExp
should not be passed to CTFE, though the question is, at which stage should it
it be rejected? When instantiating the template? At is(__parameters)? Or when
creating the delegate?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8982] Assertion failure: '0' on line 353 in file 'ctfeexpr.c'

2012-11-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8982



--- Comment #2 from Don clugd...@yahoo.com.au 2012-11-12 02:46:28 PST ---
Further reduced:

void bug8982(ref const int v = 7 ){}

static if (is(typeof(bug8982) P == __parameters)) {
pragma(msg, ((P[0..1] g) = g[0])());
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---