[Issue 10973] New: emplace internal error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 5 10:27:27 PDT 2013
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 at gmail.com
ReportedBy: monarchdodra at gmail.com
--- Comment #0 from monarchdodra at 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: -------
More information about the Digitalmars-d-bugs
mailing list