D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6945 - ICE(expression.c) arrays of missing symbols
Summary: ICE(expression.c) arrays of missing symbols
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2011-11-13 20:08 UTC by bearophile_hugs
Modified: 2012-04-21 01:29 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-11-13 20:08:37 UTC
A wrong program (it misses a like where A and B enums are defined):


enum uint foo = A | B;
enum uint[] bar = [foo];
void main() {}


DMD 2.057head gives:

Assertion failure: '0' on line 1853 in file 'expression.c'
Comment 1 yebblies 2011-12-12 22:46:22 UTC
foo's initializer is evaluated once with errors gagged for the foo declaration, then again when it's used in bar's declaration.  The type ends up full of errors, but the error count is never incremented.

I don't really understand why it's doing this, and the correct place to run (or re-run) semantic ungagged is unclear.  The comment at 1411 in declaration.c doesn't really help, and the code is ancient.
Comment 2 SomeDude 2012-04-21 01:11:49 UTC
This one gives correct compilation messages on 2.059:

PS E:\DigitalMars\dmd2\samples> rdmd bug
bug.d(1): Error: undefined identifier A
bug.d(1): Error: undefined identifier B
Comment 3 yebblies 2012-04-21 01:29:09 UTC
(In reply to comment #2)
> This one gives correct compilation messages on 2.059:
> 
> PS E:\DigitalMars\dmd2\samples> rdmd bug
> bug.d(1): Error: undefined identifier A
> bug.d(1): Error: undefined identifier B

This was probably fixed as part of the issue 4269 gagging changes.

Please feel free to close bugs if you can verify they work with current D1 and D2 compilers.