Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 04, 2010 [Issue 4424] New: Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4424 Summary: Copy constructor and templated opAssign cannot coexist Product: D Version: 2.041 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: rsinfu@gmail.com --- Comment #0 from Shin Fujishiro <rsinfu@gmail.com> 2010-07-04 04:25:29 PDT --- Templated opAssign cannot be declared in a struct with copy constructor. -------------------- test.d struct S { this(this) {} void opAssign(T)(T rhs) if (! is(T == S)) {} } -------------------- % dmd -o- -c test test.d: Error: function test.S.opAssign conflicts with template test.S.opAssign(T) if (!is(T == S)) at test.d(4) -------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 04, 2010 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Andrei Alexandrescu <andrei@metalanguage.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrei@metalanguage.com --- Comment #1 from Andrei Alexandrescu <andrei@metalanguage.com> 2010-07-04 15:19:12 PDT --- That's an important issue. I just committed a fix to Tuple that replaces opAssign with assign, but that should only be considered a workaround. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 23, 2010 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug@yahoo.com.au --- Comment #2 from Don <clugdbug@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: ------- |
April 28, 2011 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 --- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2011-04-28 12:53:39 PDT --- Created an attachment (id=955) test cases Patch created: https://github.com/9rnsr/dmd/compare/master...fix4424 Behaviors: - if template opAssign exists, check it is identity opAssign. - if template identity opAssign need, following opAsign build: ref S opAsign(T:S)(T s) if (is(T == S)) { T tmp = this; // bit copy this = s; // bit copy tmp.dtor(); return this; } - no changes with non tempate opAssign. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 16, 2011 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Cristi Cobzarenco <cristi.cobzarenco@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cristi.cobzarenco@gmail.com --- Comment #4 from Cristi Cobzarenco <cristi.cobzarenco@gmail.com> 2011-08-16 14:03:26 PDT --- The link Kenji posted is not working any more. Here's a link to his pull request that fixes this issue, as well as Issue 6216: https://github.com/D-Programming-Language/dmd/pull/166 I hope this gets pulled soon. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 06, 2012 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 kennytm@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kennytm@gmail.com --- Comment #5 from kennytm@gmail.com 2012-02-06 12:39:41 PST --- *** Issue 7427 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 01, 2012 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Dmitry Olshansky <dmitry.olsh@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmitry.olsh@gmail.com --- Comment #6 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2012-08-01 14:28:56 PDT --- I've hit this one today and failed to workaround it in any acceptable way. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 03, 2012 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Benjamin Thaut <code@benjamin-thaut.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |code@benjamin-thaut.de --- Comment #7 from Benjamin Thaut <code@benjamin-thaut.de> 2012-10-03 07:04:16 PDT --- (In reply to comment #6) > I've hit this one today and failed to workaround it in any acceptable way. This is the workaround used in phobos, it works pretty well for me too. private mixin template _workaround4424() { @disable void opAssign(typeof(this) ); } mixin _workaround4424; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 07, 2012 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |FIXED --- Comment #8 from yebblies <yebblies@gmail.com> 2012-10-08 05:48:34 EST --- https://github.com/D-Programming-Language/dmd/commit/5b42e51481d186ee5e3c2684a237a05cea33a0cf -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 03, 2012 [Issue 4424] Copy constructor and templated opAssign cannot coexist | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shin Fujishiro | http://d.puremagic.com/issues/show_bug.cgi?id=4424 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |malteskarupke@web.de --- Comment #9 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-03 05:34:12 PDT --- *** Issue 8926 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation