Bug 6326 – [CTFE] ICE on cross-module call of function checking CTFE-ability of function with invalid switch statement
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-07-15T10:40:00Z
Last change time
2011-07-26T21:11:27Z
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2011-07-15T10:40:19Z
Tested with DMD 2.053.
Took me some time to reduce this:
A.d:
import B;
void main(){foo();}
B.d
int bar(){switch(0){};} // any switch statement that does not compile will do.
auto foo(){static if(__traits(compiles,{enum x=bar();})){}}
This code provokes an internal compiler error:
$ dmd A B
dmd: statement.c:2758: virtual Statement* SwitchStatement::semantic(Scope*): Assertion `!cases' failed.
Aborted
Comment #1 by clugdbug — 2011-07-26T21:11:27Z
*** This issue has been marked as a duplicate of issue 5453 ***