Bug 6720 – ICE(cod1.c) casting return of void function to bool

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2011-09-23T12:20:00Z
Last change time
2015-06-09T05:11:50Z
Keywords
ice
Assigned to
clugdbug
Creator
cokebuttle

Comments

Comment #0 by cokebuttle — 2011-09-23T12:20:50Z
When compiling following code: void main() { bool x = cast(bool)main(); } The compiler aborts with following error message: Internal error: ../ztc/cod1.c 1909 This is an error message from dmd version 2.055.
Comment #1 by clugdbug — 2011-09-23T23:07:30Z
Not a regression. Applies even to prehistoric versions of D (same behaviour on D0.050). Not specific to main().
Comment #2 by clugdbug — 2012-01-30T10:54:29Z
I've made a fix for this.
Comment #3 by github-bugzilla — 2012-01-30T23:22:15Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ac69d4b9893725d0eb7f40002f73d0b280214b02 Merge pull request #665 from donc/ice5796 ICE bugs 5796 and 6720
Comment #4 by bugzilla — 2012-01-31T01:10:11Z
The fix for this was reverted, as it caused failures in test funclit.d.
Comment #5 by bugzilla — 2013-10-05T18:51:47Z
Comment #6 by github-bugzilla — 2013-10-06T20:19:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fbb041fcb5be7c13160128c55d5918d2f4cd8c2e fix Issue 6720 - ICE(cod1.c) casting return of void function to bool https://github.com/D-Programming-Language/dmd/commit/7508301342358ef7690fe8b142d5ea42ba46b138 Merge pull request #2632 from WalterBright/fix6720 fix Issue 6720 - ICE(cod1.c) casting return of void function to bool
Comment #7 by github-bugzilla — 2013-10-06T20:32:34Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9c8c9bbd3a182af3e60debdd24d9d1835d3939be fix fix Issue 6720 - ICE(cod1.c) casting return of void function to bool
Comment #8 by github-bugzilla — 2013-10-06T20:35:44Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f65d8c391031c94caa807ec0b4d00c54f8522373 fix fix Issue 6720 - ICE(cod1.c) casting return of void function to bool