D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6326 - [CTFE] ICE on cross-module call of function checking CTFE-ability of function with invalid switch statement
Summary: [CTFE] ICE on cross-module call of function checking CTFE-ability of function...
Status: RESOLVED DUPLICATE of issue 5453
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-15 10:40 UTC by timon.gehr
Modified: 2011-07-26 21:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2011-07-15 10:40:19 UTC
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 Don 2011-07-26 21:11:27 UTC

*** This issue has been marked as a duplicate of issue 5453 ***