<div class="gmail_quote">On Sat, Feb 11, 2012 at 5:09 PM, Walter Bright <span dir="ltr"><<a href="mailto:walter@digitalmars.com">walter@digitalmars.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div bgcolor="#ffffff" text="#000000">
<br>
<br>
On 2/10/2012 11:12 AM, Masahiro Nakagawa wrote:
<blockquote type="cite">On Sat, Feb 11, 2012 at 3:49 AM, Walter Bright <span dir="ltr"><<a href="mailto:walter@digitalmars.com" target="_blank">walter@digitalmars.com</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
On 2/10/2012 8:59 AM, Masahiro Nakagawa wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Following code works on dmd 2.057, but causing segmentation
fault on dmd 2.058 beta.<br>
<br>
-----<br>
struct S<br>
{<br>
void foo(V)(in V v)<br>
{<br>
}<br>
<br>
void foo(Args...)(auto ref const Args args)<br>
{<br>
foreach (i, T; Args)<br>
foo(args[i]);<br>
}<br>
}<br>
<br>
void main()<br>
{<br>
S s;<br>
s.foo(10);<br>
}<br>
----<br>
<br>
Does anyone report this issue?<br>
This bug is critical for my msgpack-d and related libraries.<br>
<br>
</blockquote>
<br>
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.<br>
</blockquote>
</div>
<div><br>
</div>
<div>I retried above code using new beta on two environments.</div>
<div><br>
</div>
<div>Mac OS X 10.6.8 causes segmentation fault, but</div>
<div>Scientific Linux release 6.0 64bit works fine.</div>
<div><br>
</div>
<div>Does D allow above code?</div>
<pre></pre>
</blockquote>
<br>
Do you mean the compiler seg faults or the compiled program seg
faults?<br>
</div>
</blockquote></div><div><br></div><div>In Mac, compiled program seg faults.</div>