More on C++ stack arrays

Timon Gehr timon.gehr at gmx.ch
Mon Oct 21 13:24:20 PDT 2013


On 10/21/2013 07:53 PM, Iain Buclaw wrote:
> On 21 October 2013 18:42, Walter Bright <newshound2 at digitalmars.com> wrote:
>> On 10/21/2013 9:24 AM, Iain Buclaw wrote:
>>>
>>> http://dpaste.dzfl.pl/3e333df6
>>>
>>> PS:  Walter, looks the above causes an ICE in DMD?
>>
>>
>> All ICE's should be filed in bugzilla:
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=11315
>>
>
> I've told enough people to raise bugs in GDC to know this.  My
> intention wasn't to find a bug in DMD though when I pasted that link.
> ;-)
>
> I was more curious what LDC does if it stack allocates array literals
> assigned to static arrays in that program.  My guess is that the
> dynamic array will get the address of the stack allocated array
> literal, and it's values will be lost after calling fill();
>
> If so, this is another bug that needs to be filled and fixed.
>

Why? AFAICS it is the expected behaviour in any case.


More information about the Digitalmars-d mailing list