[Issue 4424] Copy constructor and templated opAssign cannot coexist

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 23 00:10:22 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4424


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #2 from Don <clugdbug at yahoo.com.au> 2010-09-23 00:09:42 PDT ---
Don't have a full patch yet, but this is where the problem is.

clone.c, StructDeclaration::buildOpAssign().

    Parameter *param = new Parameter(STCnodtor, type, Id::p, NULL);
    Parameters *fparams = new Parameters;
    fparams->push(param);
    Type *ftype = new TypeFunction(fparams, handle, FALSE, LINKd);
#if STRUCTTHISREF
    ((TypeFunction *)ftype)->isref = 1;
#endif

    fop = new FuncDeclaration(0, 0, Id::assign, STCundefined, ftype);

+     Dsymbol *s = search_function(this, Id::assign);
+     TemplateDeclaration *td = s ? s->isTemplateDeclaration() : NULL;
+     if (td)
+     { // we need to make a template function instead

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


More information about the Digitalmars-d-bugs mailing list