www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 2291] New: negative default values for int template arguments -> duplicate symbol

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2291

           Summary: negative default values for int template arguments ->
                    duplicate symbol
           Product: DGCC aka GDC
           Version: unspecified
          Platform: Macintosh
        OS/Version: Mac OS X
            Status: NEW
          Keywords: link-failure, rejects-valid
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn users.sf.net
        ReportedBy: fawzi gmx.ch


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)


-- 
Aug 19 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2291






Created an attachment (id=271)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=271&action=view)
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.


-- 
Aug 19 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2291


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



Fixed in hg commit 143 / release 0.25

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 05 2010