Re: segfault in ldc release only - looks like some kind of optimization bug?

2019-07-22 Thread Exil via Digitalmars-d-learn
On Tuesday, 23 July 2019 at 00:54:08 UTC, aliak wrote: On Tuesday, 23 July 2019 at 00:36:49 UTC, Exil wrote: auto ref get(T)(W!T value) { return value.front; } You're returning a reference to a temporary that gets deleted at the end of the function's scope. The "auto ref" here will be a

Re: segfault in ldc release only - looks like some kind of optimization bug?

2019-07-22 Thread aliak via Digitalmars-d-learn
On Tuesday, 23 July 2019 at 00:36:49 UTC, Exil wrote: auto ref get(T)(W!T value) { return value.front; } You're returning a reference to a temporary that gets deleted at the end of the function's scope. The "auto ref" here will be a "ref". . oh ... shit you're right. Ok so this

Re: segfault in ldc release only - looks like some kind of optimization bug?

2019-07-22 Thread Exil via Digitalmars-d-learn
auto ref get(T)(W!T value) { return value.front; } You're returning a reference to a temporary that gets deleted at the end of the function's scope. The "auto ref" here will be a "ref".