Bug 6945 – ICE(expression.c) arrays of missing symbols
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-11-13T20:08:00Z
Last change time
2012-04-21T01:29:09Z
Keywords
ice
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-11-13T20:08:37Z
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 by yebblies — 2011-12-12T22:46:22Z
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 by lovelydear — 2012-04-21T01:11:49Z
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 by yebblies — 2012-04-21T01:29:09Z
(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.