[dmd-beta] D2 2.058 beta
Masahiro Nakagawa
repeatedly at gmail.com
Fri Feb 10 11:12:09 PST 2012
On Sat, Feb 11, 2012 at 3:49 AM, Walter Bright <walter at digitalmars.com>wrote:
>
>
> On 2/10/2012 8:59 AM, Masahiro Nakagawa wrote:
>
>> Following code works on dmd 2.057, but causing segmentation fault on dmd
>> 2.058 beta.
>>
>> -----
>> struct S
>> {
>> void foo(V)(in V v)
>> {
>> }
>>
>> void foo(Args...)(auto ref const Args args)
>> {
>> foreach (i, T; Args)
>> foo(args[i]);
>> }
>> }
>>
>> void main()
>> {
>> S s;
>> s.foo(10);
>> }
>> ----
>>
>> Does anyone report this issue?
>> This bug is critical for my msgpack-d and related libraries.
>>
>>
> This compiles for me without error. When it runs, I get a stack overflow.
> The reason looks clear - foo(Args) is recursively calling itself. I don't
> think it's a bug in dmd.
>
I retried above code using new beta on two environments.
Mac OS X 10.6.8 causes segmentation fault, but
Scientific Linux release 6.0 64bit works fine.
Does D allow above code?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20120211/24165ea6/attachment.html>
More information about the dmd-beta
mailing list