Bug 4738 – ICE using null array in static/constraint if

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-08-26T20:35:00Z
Last change time
2010-09-22T03:07:47Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
rsinfu
Depends on
1982

Comments

Comment #0 by rsinfu — 2010-08-26T20:35:01Z
Since dmd r629: ICE(expression.c, 816) occurs when null array is used in static-if or template constraint. Repro. -------------------- test.d static if (string.init.length > 0) // null array { } -------------------- % dmd -c -o- test Assertion failed: (precedence[e->op] != PREC_zero), function expToCBuffer, file expression.c, line 816. -------------------- It was a rejects-valid bug 1982 before r629. -------------------- % dmd-r628 -c -o- test test.d(1): Error: expression (null.length) > 0u is not constant or does not evaluate to a bool --------------------
Comment #1 by rsinfu — 2010-08-26T20:40:34Z
The phobos' std.conv hits this issue. % dmd -c -unittest std/conv.d Assertion failed: (precedence[e->op] != PREC_zero), function expToCBuffer, file expression.c, line 816.
Comment #2 by clugdbug — 2010-08-31T01:02:30Z
Fixed svn 651.
Comment #3 by 2korden — 2010-09-22T03:05:52Z
Got this issue today. Should I reopen the bug or submit a new ticket?
Comment #4 by 2korden — 2010-09-22T03:07:47Z
Original test case has been fixed so I'll create a new report. Sorry for the buzz.