www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10973] New: emplace internal error

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

           Summary: emplace internal error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: monarchdodra gmail.com
        ReportedBy: monarchdodra gmail.com


--- Comment #0 from monarchdodra gmail.com 2013-09-05 10:27:26 PDT ---
Conditions: Use aggregate initialization on a structure that has a static
array, while making the argument an element type of the array. EG:

//----
import std.conv;

struct S
{
    int i;
    int[2] ii;
}

void main()
{
    S s = S(1, 2); //OK
    emplace(&s, 1, 2); //Chokes
}
//----

The issue is in "emplacePostblitter", which is confused when it is asked to
postblit a type over something that isn't the same type.

"Luckilly", compilation stops, instead of potentially doing wrong code.

On topic, I'm really not a huge fan of "S s = S(1, 2); //OK": This is basically
implicit promotion from "int" to "int[2]". D usually bans implicit pormotion,
and *every time* I have seen this "aggregate initialization with static array
promotion" "feature" I (and others on the boards) have been surprised by it.

Introduced by pull:
https://github.com/D-Programming-Language/phobos/pull/1082

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973



--- Comment #1 from monarchdodra gmail.com 2013-09-06 08:09:50 PDT ---
While I am at it: emplacePostblitter does not correctly handle class types
either, if one of the nested members is a class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 06 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2013-10-08
02:12:00 PDT ---
(In reply to comment #0)
 Introduced by pull:
 https://github.com/D-Programming-Language/phobos/pull/1082
It's getting close to beta time. We should either revert this pull to fix the regression, or fix it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973



--- Comment #3 from monarchdodra gmail.com 2013-10-08 03:42:09 PDT ---
Hum. I forgot to link back.

First, this is a trivial reformat:
https://github.com/D-Programming-Language/phobos/pull/1552

Then, this fixes the issues 10973 and 10978:
https://github.com/D-Programming-Language/phobos/pull/1567




In parallel:
This adds only extra unittests, that proves "array" works better than before:
https://github.com/D-Programming-Language/phobos/pull/1528

This fixes "appender" to correctly use emplace, which fixes a bug we are
regularly hitting:
https://github.com/D-Programming-Language/phobos/pull/1529

It just needs some reviewing now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973



--- Comment #4 from monarchdodra gmail.com 2013-10-20 03:34:09 PDT ---
(In reply to comment #3)
 Hum. I forgot to link back.
 
 First, this is a trivial reformat:
 https://github.com/D-Programming-Language/phobos/pull/1552
Pulled
 Then, this fixes the issues 10973 and 10978:
 https://github.com/D-Programming-Language/phobos/pull/1567
Relocated: https://github.com/D-Programming-Language/phobos/pull/1629
 In parallel:
 This adds only extra unittests, that proves "array" works better than before:
 https://github.com/D-Programming-Language/phobos/pull/1528
Pulled
 This fixes "appender" to correctly use emplace, which fixes a bug we are
 regularly hitting:
 https://github.com/D-Programming-Language/phobos/pull/1529
Still open. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973


David Nadlinger <code klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |code klickverbot.at
         Resolution|                            |FIXED


--- Comment #5 from David Nadlinger <code klickverbot.at> 2013-10-20 06:27:20
PDT ---
Merged:
https://github.com/D-Programming-Language/phobos/commit/edf906bc7f88c958ef6e5a7c391b5b76d7aa1779

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10973



--- Comment #6 from David Nadlinger <code klickverbot.at> 2013-10-20 06:30:31
PDT ---
https://github.com/D-Programming-Language/phobos/pull/1629
https://github.com/D-Programming-Language/phobos/commit/edf906bc7f88c958ef6e5a7c391b5b76d7aa1779

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