dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
Hi ! Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? import std.stdio; enum LiftingGender { PREDICT, UPDATE, } struct Test(float[][] coeffs, int[] offsets, LiftingGender gender) { immutable float[][] coeffs = coeffs

Re: dmd segfaults

2014-05-31 Thread bearophile via Digitalmars-d-learn
matovitch: Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? Please report this minimized case to Bugzilla: struct Foo(int[] arr) { const int[] arr = arr; } void main() { Foo!([0]) foo; } The error it gives before the crash: test.d(2,17

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
On Saturday, 31 May 2014 at 17:01:23 UTC, bearophile wrote: matovitch: Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? Please report this minimized case to Bugzilla: struct Foo(int[] arr) { const int[] arr = arr; } void main() { Foo!([0]) foo

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
In fact it segfauls on any template parameter if it has the same name as the immutable member (at least it's coherent). Something as simple as : struct Foo(int i) { immutable int i = i; } void main() { Foo!5 foo; writeln(foo); } I am suprised that nobody tried this before. BTW I

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
I remembered my psswd don't take my last sentence into account (i will filed this).

Re: dmd segfaults

2014-05-31 Thread via Digitalmars-d-learn
On Saturday, 31 May 2014 at 17:22:41 UTC, matovitch wrote: In fact it segfauls on any template parameter if it has the same name as the immutable member (at least it's coherent). Something as simple as : struct Foo(int i) { immutable int i = i; } void main() { Foo!5 foo;

Re: dmd segfaults

2014-05-31 Thread matovitch via Digitalmars-d-learn
I updated the issue. Strangely if done in the main everything is fine : Error: undefined identifier i

Re: dmd segfaults

2014-05-31 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 31, 2014 at 04:50:11PM +, matovitch via Digitalmars-d-learn wrote: Hi ! Does anybody knows why dmd segfaults on this code ? Should I report this as a bug ? [...] Compiler segfaults should always be reported. No matter how wrong the code may be, it is never right

dmd segfaults on nested template instantiation (eg A!(A!(int)) )

2013-09-18 Thread Timothee Cour
I just filed a bug report ( http://d.puremagic.com/issues/show_bug.cgi?id=11067) Is there a workaround that keeps same syntax for user code? Use case: i'm generating those from swig(+modifications to map C++ templates to D templates) so I can't factor the template bodies for different template