Bug 2294 – negative default values for int template arguments does not work

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
PowerPC
OS
Mac OS X
Creation time
2008-08-19T10:26:00Z
Last change time
2014-02-24T15:33:42Z
Keywords
link-failure, rejects-valid
Assigned to
nobody
Creator
fawzi
Blocks
2291

Comments

Comment #0 by fawzi — 2008-08-19T10:26:50Z
something like this: {{{ class MyClass(int startAxis1=-1){ this() {} } void main(){ MyClass!() aa=new MyClass!()(); } }}} fails to compile. not using the default (either by explicit instantiation or removing it), or a positive default value don't give any problem. I have found this error with gdmd, and posted it as issue http://d.puremagic.com/issues/show_bug.cgi?id=2291 (see also my attachment there) but I have tested with codepad and also dmd fails.
Comment #1 by clugdbug — 2009-10-28T05:47:46Z
I cannot reproduce on any version of DMD Windows. I've tried 0.175, 1.0, 1.020, 1.023, 1.028, 1.045, and they all work.
Comment #2 by clugdbug — 2010-09-22T12:35:59Z
I can reproduce this on codepad. Codepad claims to be using DMD 1.026, but 1.026 definitely works on Windows. This was probably fixed a very long time ago.
Comment #3 by clugdbug — 2010-09-22T12:37:55Z
Without some evidence that this is still current, I'm marking this as closed. Reopen if still current, with information on which platform it is visible on.