Reported by %u.
------------
struct S
{
static int func() {
S s;
int e;
switch( e )
{ default: return 0;
}
}
static int[1] ARR = [func() ];
}
----
Assertion failure: '!cases' on line 2741 in file 'statement.c'
abnormal program termination
It's happening because the CTFE for ARR speculatively runs func().
There's a 'no size yet for forward referenced struct' error because S isn't complete yet. But this happens with errors gagged.
The SwitchStatement completes its semantic pass correctly.
But, because "S s;" failed, semantic gets run again for func(), without errors gagged this time. SwitchStatement::semantic() detects it's been run twice, and asserts.
Comment #1 by clugdbug — 2011-07-26T21:11:27Z
*** Issue 6326 has been marked as a duplicate of this issue. ***