Bug 1197 – "static if" + enum.max/enum.min doesn't compile (D1 only)

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-04-27T12:59:53Z
Last change time
2019-05-23T12:03:55Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Thomas Kühne
Blocks
340

Comments

Comment #0 by thomas-dloop — 2007-04-27T12:59:53Z
# const int[E.max] array; # # enum E{ # A = 1, # B, # C # } # # int main(){ # static if(E.max == 3){ # static if(array.length == 3){ # return 0; # } # } # } test cases: http://dstress.kuehne.cn/run/e/enum_43_A.d http://dstress.kuehne.cn/run/e/enum_43_B.d http://dstress.kuehne.cn/run/e/enum_43_G.d http://dstress.kuehne.cn/run/e/enum_43_H.d
Comment #1 by clugdbug — 2009-04-03T06:05:48Z
No longer segfaults on DMD1.042 and 2.027 -- now generates a "forward reference" error message. This is still a regression.
Comment #2 by smjg — 2009-04-04T08:59:59Z
Then don't just delete the keyword - assign the correct one!
Comment #3 by clugdbug — 2009-04-04T10:17:59Z
(In reply to comment #2) > Then don't just delete the keyword - assign the correct one! > I thought of doing that, but 'regression' normally applies to valid code. Regression of invalid code is a hundred times less serious. So I added the 'regression' to the description, rather than the severity.
Comment #4 by r.sagitario — 2009-09-18T01:41:45Z
Works for DMD 2.032 here, but not for DMD 1.047
Comment #5 by clugdbug — 2010-08-31T03:33:48Z
The fact that it doesn't work on D1 isn't actually a regression. The regression was fixed in 1.021-1.023. It never actually worked on D1. Here's the full behaviour: Segfault on 0.140, forward reference error 0.150-1.010, segfault 1.013-1.020, forward reference error 1.023-present. Segfault 2.000, forward reference 2.012-2.030, works 2.031- present. Downgrading to normal.
Comment #6 by uplink.coder — 2018-08-27T13:50:58Z
Compiles since as of 2.068 ... maybe even sooner
Comment #7 by ag0aep6g — 2018-08-27T22:00:25Z
(In reply to Stefan Koch from comment #6) > Compiles since as of 2.068 ... maybe even sooner You seem to have missed the "(D1 only)" part. Reopening. (It may be time to just close all D1 bugs as WONTFIX, though.)
Comment #8 by razvan.nitu1305 — 2019-05-23T12:03:55Z
As per Dconf AGM, all D1 that do not manifest in D2 bugs shall be closed.