Bug 2291 – negative default values for int template arguments -> duplicate symbol

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
PowerPC
OS
Mac OS X
Creation time
2008-08-19T04:49:00Z
Last change time
2015-06-09T05:14:50Z
Keywords
link-failure, rejects-valid
Assigned to
ibuclaw
Creator
fawzi
Depends on
2294

Attachments

IDFilenameSummaryContent-TypeSize
271t.zipsample assembler by a working and non working programapplication/octet-stream3456

Comments

Comment #0 by fawzi — 2008-08-19T04:49:39Z
something like this: {{{ class A(int startAxis1=-1){ this() {} } void main(){ A!() aa=new A!()(); } }}} give an error like this: /var/tmp//ccjRO3sd.s:106:FATAL:Symbol __D1t6__T1AZ1A5_ctorMFZC1t6__T1AZ1A already defined. not using the default (either by explicit instantiation or removing it), or a positive default value don't give any problem. maybe also dmd has the same problem (not tested)
Comment #1 by fawzi — 2008-08-19T06:48:32Z
Created attachment 271 sample assembler by a working and non working program default argument having the problem (t.d,t.s) and explicit argument working (t2.d t2.s). Most of the differences are the explicit -1 argument (mangled to ViN1), but duplicated (wrong) code can be easily seen.
Comment #2 by ibuclaw — 2010-08-05T15:08:13Z
Fixed in hg commit 143 / release 0.25