[Issue 16652] [Reg 2.071] returned rvalue destroyed too early

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16652

--- Comment #2 from Walter Bright  ---
A further reduction:

struct Vector {
this(ubyte a) {
pragma(inline, false);
buf = a;
}

~this() {
pragma(inline, false);
buf = 0;
}

ubyte buf;
}

void bar(ubyte* v) {
pragma(inline, true);
assert(*v == 1);
}

void main() {
bar(&Vector(1).buf);
}

It's the inlining of bar() that elicits the bug.

--


[Issue 15459] [REG2.065.0] stdin.byLine.each!(map!somefunc) compiles, fails to link with ld

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15459

Walter Bright  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution|--- |WORKSFORME

--- Comment #11 from Walter Bright  ---

(In reply to Simon Naarmann from comment #0)
> http://dpaste.dzfl.pl/ce501c212d32
> 
> This code calls byLine, each, map!somefunc. It compiles fine, but fails to
> link. Tested on my Linux machine with DMD 2.069.2 and on dpaste with DMD
> 2.069.1.
> 
> Expected: Either an error during compilation, or a well-linked executable.
> 
> Code copied here for convenience:
> 
> #!/usr/bin/rdmd
> 
> import std.stdio;
> import std.algorithm;
> 
> char somefunc(in char c)
> {
> return c;
> }
> 
> void main()
> {
> stdin
> .byLine
> .each!(map!somefunc);
> }
> 
> dmd outputs:

I get:

test.d(13): Error: template `std.algorithm.iteration.each!(map).each` cannot
deduce function from argument types `!()(ByLine!(char, char))`, candidates are:
c:\cbx\mars\phobos\std\algorithm\iteration.d(890):   
`std.algorithm.iteration.each!(map).each(Range)(Range r) if
(!isForeachIterable!Range && (isRangeIterable!Range || __traits(compiles,
typeof(r.front).length)))`
c:\cbx\mars\phobos\std\algorithm\iteration.d(925):   
`std.algorithm.iteration.each!(map).each(Iterable)(auto ref Iterable r) if
(isForeachIterable!Iterable || __traits(compiles,
Parameters!(Parameters!(r.opApply`

So it works for me.

--


[Issue 16214] [REG2.069] ICE: Assertion `fd->semanticRun == PASSsemantic3done' failed.

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16214

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution|--- |WORKSFORME

--- Comment #2 from Walter Bright  ---
It's working now.

--


[Issue 18815] thread_attachThis crash

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18815

--- Comment #4 from Walter Bright  ---
(In reply to Walter Bright from comment #3)
> It is likely crashing because your main() is on the C++ side, and so the D
> runtime library never gets initialized.

Oh, I see you called rt_init().

--


[Issue 18815] thread_attachThis crash

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18815

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #3 from Walter Bright  ---
It is likely crashing because your main() is on the C++ side, and so the D
runtime library never gets initialized.

--


[Issue 18810] root/ctfloat depends upon backend

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18810

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #2 from Walter Bright  ---
Why not just add strtold_dm.c to the LDC project? I'm not sure why it has to be
translated to be D to be useful in LDC?

--


[Issue 16284] [REG2.067] CTFE internal error: bad compare

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16284

--- Comment #5 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/d476b023a46b62c727ee701cf9efa518d8e29361
fix Issue 16284 - [REG2.067] CTFE internal error: bad compare

https://github.com/dlang/dmd/commit/717bfd9dfacfa298ccbddbacfd35fd2920189eb7
Merge pull request #9077 from WalterBright/fix16284

fix Issue 16284 - [REG2.067] CTFE internal error: bad compare

--


[Issue 16284] [REG2.067] CTFE internal error: bad compare

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16284

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16284] [REG2.067] CTFE internal error: bad compare

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16284

--- Comment #4 from Walter Bright  ---
(In reply to Mike Franklin from comment #2)
> Potential Fix: https://github.com/dlang/dmd/pull/7302

Rebooted as https://github.com/dlang/dmd/pull/9077

--


[Issue 19485] New: Add more predefined versions

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19485

  Issue ID: 19485
   Summary: Add more predefined versions
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: andrew.penneba...@gmail.com

D's builtin version identifiers are a fairly exhaustive list! Could we add
MINIX and HardenedBSD to the list?

They should be easy to identify with a "Minix", "HBSD" match on `uname -a`,
respectively.

I'd also like to see some musl/Linux editions identified, though those tend to
not appear in a distinguishing way with uname, but instead via `lsb_release
-a`, e.g. "Void" for Void Linux.

--


[Issue 18938] Dmd segfault when compiling this dub package in test release

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18938

Walter Bright  changed:

   What|Removed |Added

   Hardware|x86_64  |All
 OS|Linux   |All

--


[Issue 19447] [REG2.066] fixed size slice assignment in ctfe loses connection with array

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19447

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/c807c046be63c9787500424e64910f6d52e1f767
fix Issue 19447 - [REG2.066] fixed size slice assignment in ctfe loses
connection with array

https://github.com/dlang/dmd/commit/6064ba87796fcba76f8f00613d3ae4a5c2c2376d
Merge pull request #9071 from WalterBright/fix19447

fix Issue 19447 - [REG2.066] fixed size slice assignment in ctfe loseā€¦

--


[Issue 19447] [REG2.066] fixed size slice assignment in ctfe loses connection with array

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19447

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 19481] Aborting from local/libphobos/libdruntime/core/sync/mutex.d(95) Error: pthread_mutex_init failed.

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19481

--- Comment #6 from ki...@gmx.net ---
Yep, looks fine, and definitely keep the `align(mutexAlign)`. :) - You could
get away with a single `alignedMutexInstanceSize` enum (and no
`mutexInstanceSize`) by using `const init = typeid(Mutex).initializer; lock[0
.. init.length] = init[];`.

--


[Issue 19484] New: Fix it so that DirEntry on POSIX only calls lstat once

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19484

  Issue ID: 19484
   Summary: Fix it so that DirEntry on POSIX only calls lstat once
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: issues.dl...@jmdavisprog.com

On POSIX, DirEntry's constructor calls exists to verify that the file exists
and then throws if it doesn't - which makes perfect sense until you look at
what exists does. exists calls lstat, which is fine in and of itself, but
calling exists means that that information is thrown away, whereas DirEntry
then later calls lstat again when certain functions are called. It has the
_didLStat member to keep track of whether it's called lstat yet, so it avoids
calling it multiple times when the properties on it are used which require it,
but it would be more efficient to just call lstat directly in the constructor
and always save the result. If lstat fails, the exception can be thrown like it
is now, but by checking the result of lstat directly rather than using exists,
we remove the need for _didLStat, and we make it so that lstat is always called
exactly once instead of being called once if the information from lstat isn't
needed later or twice if it is.

--


[Issue 19481] Aborting from local/libphobos/libdruntime/core/sync/mutex.d(95) Error: pthread_mutex_init failed.

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19481

--- Comment #5 from Iain Buclaw  ---
(In reply to kinke from comment #4)
> Argh, it's an array, and class instances aren't padded... - the error stems
> from the manual initialization in `initLocks()`, right? That should be
> easily adaptable; the ctor only gets the `this` pointer and shouldn't have
> any idea about the actual size.

Correct.

This line:

__gshared align(Mutex.alignof) void[__traits(classInstanceSize, Mutex)][2]
_locks;


The size should be rounded up to a suitable align boundary, then this line:

lock[] = typeid(Mutex).initializer[];

The slice assignment is adjusted to only initialize up to
__traits(classInstanceSize, Mutex).

So we end up with something that looks like:

---

version (Windows)
{
import core.sys.windows.winbase : CRITICAL_SECTION;
enum lockAlign = CRITICAL_SECTION.alignof;
}
else version (Posix)
{
import core.sys.posix.sys.types : pthread_mutex_t;
enum lockAlign = pthread_mutex_t.alignof;
}

enum mutexInstanceSize = __traits(classInstanceSize, Mutex)
enum lockAlignedSize = (mutexInstanceSize + lockAlign - 1) & ~(lockAlign - 1);

__gshared align(lockAlign) void[lockAlignedSize][2] _locks;

static void initLocks() @nogc
{
foreach (ref lock; _locks)
{
lock[0 .. mutexInstanceSize] = typeid(Mutex).initializer[];
(cast(Mutex)lock.ptr).__ctor();
}
}

---

I don't think `align(lockAlign)` is really necessary based on feedback, but it
covers us "just incase".

--


[Issue 19481] Aborting from local/libphobos/libdruntime/core/sync/mutex.d(95) Error: pthread_mutex_init failed.

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19481

--- Comment #4 from ki...@gmx.net ---
Argh, it's an array, and class instances aren't padded... - the error stems
from the manual initialization in `initLocks()`, right? That should be easily
adaptable; the ctor only gets the `this` pointer and shouldn't have any idea
about the actual size.

--


[Issue 7616] aggregates don't inherit pure nothrow from outer scope

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7616

|  changed:

   What|Removed |Added

 CC||dhase...@gmail.com

--- Comment #3 from |  ---
https://github.com/dlang/dmd/pull/9076

--


[Issue 19481] Aborting from local/libphobos/libdruntime/core/sync/mutex.d(95) Error: pthread_mutex_init failed.

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19481

--- Comment #3 from Iain Buclaw  ---
According to response, the alignment of _locks[0] is fine, _locks[1] is the
problem.


>>>

Unfortunately, this doesn't work: the first time through, _locks[0] was
already 8-byte aligned and everything worked fine.  This remained when
using align(8) instead.  However, Mutex is 44 bytes on 32-bit
Solaris/x86, so again _locks[1] lands on a non-8 byte boundary and
pthread_mutex_init fails.

I tried rouding up the size of the _locks array members to a multiple of
8, but that let the constructor already fail the first time through
where _d_arraycopy checks that the right amount of data is copied:

_d_arraycopy -> rt.util.array.enforceRawArraysConformable ->
rt.util.array._enforceSameLength

<<<

--


[Issue 18938] Dmd segfault when compiling this dub package in test release

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18938

--- Comment #6 from RazvanN  ---
(In reply to Walter Bright from comment #4)
> When I run it I get:
> 
> source/inilike\file.d(45): Deprecation: `std.algorithm.setops.No` is not
> visible from module `inilikefile`
> source/inilike\file.d(32): Error: `template` has no effect in expression
> `map(Range)(Range r) if (isInputRange!(Unqual!Range))`
> 
> and no seg fault.

Maybe you are using a compiler < 2.0.79

--


[Issue 18938] Dmd segfault when compiling this dub package in test release

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18938

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #5 from RazvanN  ---
I can reproduce it.

PR: https://github.com/dlang/dmd/pull/9075

--


[Issue 16284] [REG2.067] CTFE internal error: bad compare

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16284

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #3 from Walter Bright  ---
This is still active:

test.d(13): Error: CTFE internal error: bad compare of void and void

--


[Issue 17179] dmd 2.073 betas segfault while trying to build vibe.d project

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17179

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #3 from Walter Bright  ---
Since this is nearly two years old, there is insufficient information, and
there is no further information, I'm going to close it.

--


[Issue 18864] Building 64-bit dmd on Windows results in a binary that crashes

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18864

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution|--- |FIXED

--- Comment #10 from Walter Bright  ---
(In reply to kinke from comment #8)
> I think I found the culprit causing the sporadic segfaults:
> https://github.com/dlang/dmd/pull/8294

Since that PR was merged, I assume the bug was fixed and will close this.

In the future, when entitling PRs that address bugzilla issues, please use:

"fix Issue 18864 - Building 64-bit dmd on Windows results in a binary that
crashes"

so that merging the PR will automatically mark the issue as resolved.

--


[Issue 18938] Dmd segfault when compiling this dub package in test release

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18938

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #4 from Walter Bright  ---
When I run it I get:

source/inilike\file.d(45): Deprecation: `std.algorithm.setops.No` is not
visible from module `inilikefile`
source/inilike\file.d(32): Error: `template` has no effect in expression
`map(Range)(Range r) if (isInputRange!(Unqual!Range))`

and no seg fault.

--


[Issue 19205] [REG 2.081] Cannot call superclass ctor after end of switch statement

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19205

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=18688

--


[Issue 18688] Constructors shouldn't have implicit super call if it throws

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18688

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=19205

--


[Issue 19211] get the type of a non-const delegate in a const function

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19211

Walter Bright  changed:

   What|Removed |Added

Summary|[REG 2.072] cant get the|get the type of a non-const
   |type of a non-const |delegate in a const
   |delegate in a const |function
   |function|
   Severity|regression  |enhancement

--


[Issue 19211] [REG 2.072] cant get the type of a non-const delegate in a const function

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19211

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
I'm not so sure this is a good idea to change this, as changing it could
destabilize the type checking inside the typeof().

(It is erroneous code - the type checking is working as designed.)

The error message is not exactly wrong, though it could be improved. Changed to
enhancement request.

--


[Issue 19227] S.init is S.init failing for struct with float member

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19227

--- Comment #2 from Walter Bright  ---
https://github.com/dlang/dmd/pull/9073

--


[Issue 19227] S.init is S.init failing for struct with float member

2018-12-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19227

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com
Summary|`S.init is S.init` failing  |S.init is S.init failing
   |for struct with float   |for struct with float
   |member  |member

--