[Issue 16614] [META] Each artifact in the standard library should have a meaningful example

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16614
Issue 16614 depends on issue 8799, which changed state.

Issue 8799 Summary: Give example of Tuple mapped to a function
https://issues.dlang.org/show_bug.cgi?id=8799

   What|Removed |Added

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

--


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

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16652

Martin Nowak  changed:

   What|Removed |Added

Summary|returned rvalue gets|[Reg 2.071] returned rvalue
   |destroyed before|destroyed too early
   |expressions ends|
   Severity|major   |regression

--- Comment #1 from Martin Nowak  ---
Turns out this is actually a regression introduced by
https://github.com/dlang/dmd/pull/5292.

Also here is the test case with an assertion instead of writeln.

cat > bug.d << CODE
struct Vector
{
this(ubyte a)
{
buf[] = a;
}

ubyte[] opSlice()
{
return buf[];
}

~this()
{
buf[] = 0;
}

ubyte[4] buf;
}

void bar(ubyte[] v)
{
assert(v[0] == 1);
}

void main()
{
bar(Vector(1)[]);
}
CODE
dmd -inline -run bug

--


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

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16652

Ketmar Dark  changed:

   What|Removed |Added

 CC||ket...@ketmar.no-ip.org

--


[Issue 15862] Functions that return types with mutable indirections should be weakly pure, not strongly pure

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15862

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

https://github.com/dlang/dmd/commit/4dfc9e9252220ef724412a74b3a8caf862d0a95e
fix Issue 15862 - allocating storage in pure functions should not result in
caching return values of them

https://github.com/dlang/dmd/commit/ab9d712ad6b6a2f59e1e4427bf1627968fc65c8c
Merge pull request #6197 from WalterBright/fix15862

--


[Issue 16583] Static module ctor semantic proposition

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16583

--- Comment #2 from b2.t...@gmx.com ---
(In reply to Martin Nowak from comment #1)
> That's doesn't make sense b/c using Type could depend on the sth. being
> initialized first.
> What we could try is to teach the compiler to recognize a few more
> standalone constructors (that simply initialize plain data fields).

I don't really mind but I'd say that your argument is fallacious. Why ? Because
"Type" can have its own static ctor.

--


[Issue 16653] New: ParameterDefaultValueTuple fails to compile when function has lazy param

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16653

  Issue ID: 16653
   Summary: ParameterDefaultValueTuple fails to compile when
function has lazy param
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: goldmax3...@gmail.com

This code:

import std.traits;

void f(lazy int x = 0) {}
pragma(msg, ParameterDefaultValueTuple!f);

gives compile error

/opt/compilers/dmd2/include/std/traits.d-mixin-1216(1216): Error: lazy
variables cannot be lvalues
/opt/compilers/dmd2/include/std/traits.d(1253): Error: template instance
std.traits.ParameterDefaultValueTuple!(f).Get!0LU error instantiating
/opt/compilers/dmd2/include/std/traits.d(1256): instantiated from here:
Impl!0LU
/d321/f969.d(5): instantiated from here: ParameterDefaultValueTuple!(f)
/d321/f969.d(5): while evaluating pragma(msg, ParameterDefaultValueTuple!(f))

--


[Issue 14238] DIP25: escape checks can be circumvented with delegate

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14238

--- Comment #3 from github-bugzi...@puremagic.com ---
Commit pushed to scope at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/7c3e47a20e30672653c6330edbe22f2181a1f9c2
fix Issue 14238 - DIP25: escape checks can be circumvented with delegate

--


[Issue 15544] Escaping fields to a heap delegate must be disallowed in @safe code

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15544

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

https://github.com/dlang/dmd/commit/e61378a715e01e58365df753985d1178d5ba4bd4
fix Issue 15544 - Escaping fields to a heap delegate must be disallowed in
@safe code

--


[Issue 8838] Slicing static arrays should be considered unsafe (@system)

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8838

--- Comment #18 from github-bugzi...@puremagic.com ---
Commit pushed to scope at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/66187b5c1e1554cd6e417e3c762285d0234bb982
fix Issue 8838 - Slicing static arrays should be considered unsafe (@system)

--


[Issue 15544] Escaping fields to a heap delegate must be disallowed in @safe code

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15544

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

   What|Removed |Added

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

--


[Issue 13651] Writing Unicode text with console code page 65001 (UTF-8) may fail

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13651

Martin Krejcirik  changed:

   What|Removed |Added

 CC||m...@krej.cz

--


[Issue 14238] DIP25: escape checks can be circumvented with delegate

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14238

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

   What|Removed |Added

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

--


[Issue 12655] foldRange

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12655

Dmitry Olshansky  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||dmitry.o...@gmail.com
 Resolution|--- |FIXED

--


[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16651

ag0ae...@gmail.com changed:

   What|Removed |Added

 CC||ag0ae...@gmail.com
  Component|dmd |druntime
   Hardware|x86_64  |All
 OS|Windows |All

--- Comment #1 from ag0ae...@gmail.com ---
Same happens with -m32 and smaller types:


void main()
{
import std.stdio: writeln;
import core.atomic  : atomicOp;

shared uint foo = 2;
ubyte bar = 1;
atomicOp!"-="( foo, bar );
writeln( "foo = ", foo );// foo = 257
}


Also happens on Linux.

Looks like a bug in druntime code (core.atomic) rather than dmd. I think it
works with LDC because they've added a path of their own to druntime [1].


[1]
https://github.com/ldc-developers/druntime/blob/049b8efdf0daebcc1cfe690c5cf7585125c1ff72/src/core/atomic.d#L177

--


[Issue 8799] Give example of Tuple mapped to a function

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8799

--- Comment #3 from Lucia Cojocaru  ---
pull https://github.com/dlang/phobos/pull/4882

--


[Issue 16583] Static module ctor semantic proposition

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16583

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com

--- Comment #3 from Steven Schveighoffer  ---
module bad;

int x;

static this()
{
  x = 42;
}

struct Type
{
   int foo() { return x;}
}

--


[Issue 16609] std.experimental.ndslice.slice issues warnings when building Phobos

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16609

--- Comment #3 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/00ce4ed3a114b42f9dd30015b20c4b795fd61360
Merge pull request #4865 from 9il/tohash

fix issue 16609

--


[Issue 16419] issue with ndslice.slice toHash

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16419

--- Comment #4 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/52767078ccd2544f6ae8a5def0f75eb569465f77
fix issue 16419

--


[Issue 16609] std.experimental.ndslice.slice issues warnings when building Phobos

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16609

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

   What|Removed |Added

 Resolution|DUPLICATE   |FIXED

--


[Issue 16419] issue with ndslice.slice toHash

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16419

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

   What|Removed |Added

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

--


[Issue 8799] Give example of Tuple mapped to a function

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8799

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

https://github.com/dlang/phobos/commit/e0ca51f9f01cc2a089907b09f9e0ed3dd15df643
fix issue 8799

https://github.com/dlang/phobos/commit/c77869f22e61919a9f3d617d7d5d2254641aa7e4
Merge pull request #4882 from somzzz/issue_8799

fix issue 8799

--


[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16651

safety0ff.bugz  changed:

   What|Removed |Added

 CC||safety0ff.b...@gmail.com

--- Comment #2 from safety0ff.bugz  ---
(In reply to ag0aep6g from comment #1)
> 
> Looks like a bug in druntime code (core.atomic) rather than dmd.

Yup, atomicFetchSub [1] doesn't widen the modifier before negating it.
This is necessary when the modifier is unsigned and narrower than the value's
type.


[1] https://github.com/dlang/druntime/blob/master/src/core/atomic.d#L684

--


[Issue 8087] Improve clarity of std.algorithm documentation

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8087

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

https://github.com/dlang/phobos/commit/946a46774c58681036e12932858d0bb58f887448
Fix Issue 8087 - Improve clarity of std.algorithm documentation

https://github.com/dlang/phobos/commit/fd518eb310a9494cccf28c54892542b052c49669
Merge pull request #4883 from Darredevil/issue-8087

Fix Issue 8087 - Improve clarity of std.algorithm documentation

--


[Issue 8087] Improve clarity of std.algorithm documentation

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8087

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

   What|Removed |Added

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

--


[Issue 16614] [META] Each artifact in the standard library should have a meaningful example

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16614
Issue 16614 depends on issue 8087, which changed state.

Issue 8087 Summary: Improve clarity of std.algorithm documentation
https://issues.dlang.org/show_bug.cgi?id=8087

   What|Removed |Added

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

--


[Issue 16654] New: hashOf returns different hashes for the same string value

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16654

  Issue ID: 16654
   Summary: hashOf returns different hashes for the same string
value
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: major
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: d...@nomad.so

The following assert fails:

import std.stdio;
import std.conv;

void main(string[] args)
{
auto x = 1;

assert(hashOf(x.to!(string)) == hashOf(x.to!(string)));
}

This is because numeric values of the pointers to the strings are being
included in the hash calculation.

Discussion: http://forum.dlang.org/post/gdtaqdooaknhsmcow...@forum.dlang.org

--


[Issue 16293] hashOf should be @nogc when it can be

2016-11-01 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16293

Gary Willoughby  changed:

   What|Removed |Added

 CC||d...@nomad.so

--- Comment #1 from Gary Willoughby  ---
This seems to have been done here: https://github.com/dlang/druntime/pull/1624

--