[Issue 18782] New: Documentation error: ProtectionAttributes should say Visibility Attributes

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18782

  Issue ID: 18782
   Summary: Documentation error: ProtectionAttributes should say
Visibility Attributes
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dlang.org
  Assignee: nob...@puremagic.com
  Reporter: james.blac...@gmail.com

This section: https://dlang.org/spec/class.html#access_control

links to: https://dlang.org/spec/attribute.html#ProtectionAttribute

but should link to:

https://dlang.org/spec/attribute.html#visibility_attributes

As the anchor #ProtectionAttribute does not exist, nor does the term in the
attributes definitions page.

--


[Issue 18781] New: std.string.replace: RangeError when replacing with inconsistent string types

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18781

  Issue ID: 18781
   Summary: std.string.replace: RangeError when replacing with
inconsistent string types
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dhase...@gmail.com

void main()
{
import std.string : replace;
"”quote”"w.replace("”", `"`);
}


This crashes with:

core.exception.RangeError@/usr/include/dmd/phobos/std/array.d(2167): Range
violation

??:? _d_arrayboundsp [0x42c4ee]
/usr/include/dmd/phobos/std/array.d:2167 pure @safe void
std.array.replaceInto!(immutable(wchar),
std.array.Appender!(immutable(wchar)[]).Appender, immutable(char)[],
immutable(char)[]).replaceInto(std.array.Appender!(immutable(wchar)[]).Appender,
immutable(wchar)[], immutable(char)[], immutable(char)[]) [0x42b107]
/usr/include/dmd/phobos/std/array.d:2098 pure @safe immutable(wchar)[]
std.array.replace!(immutable(wchar), immutable(char)[],
immutable(char)[]).replace(immutable(wchar)[], immutable(char)[],
immutable(char)[]) [0x42a01b]
wstringcrash.d:4 _Dmain [0x429669]


Note that the string operated on is a wstring, and the replacements are
strings.

Conversely, calling `replace(string, wstring, wstring)` tends to result in
invalid UTF-8 sequences:

"☃ world.".replace("☃"w, `:`w);

std.utf.UTFException@/usr/include/dmd/phobos/std/utf.d(1380): Invalid UTF-8
sequence (at index 2)

--


[Issue 7549] typeof of overloaded function picks the lexically first one

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7549

Simen Kjaeraas  changed:

   What|Removed |Added

 CC||luka8...@owave.net

--- Comment #9 from Simen Kjaeraas  ---
*** Issue 8780 has been marked as a duplicate of this issue. ***

--


[Issue 8780] std.traits.ReturnType of overloaded functions

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8780

Simen Kjaeraas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||simen.kja...@gmail.com
 Resolution|--- |DUPLICATE

--- Comment #4 from Simen Kjaeraas  ---


*** This issue has been marked as a duplicate of issue 7549 ***

--


[Issue 7549] typeof of overloaded function picks the lexically first one

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7549

Simen Kjaeraas  changed:

   What|Removed |Added

 CC||mattbowiewil...@gmail.com

--- Comment #8 from Simen Kjaeraas  ---
*** Issue 18777 has been marked as a duplicate of this issue. ***

--


[Issue 16206] traits getOverloads fails when one of the overload is a templatized function

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16206

Simen Kjaeraas  changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com

--- Comment #2 from Simen Kjaeraas  ---
PR: https://github.com/dlang/dmd/pull/8195

--


[Issue 18777] std.traits.RetrunType ambiguity

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18777

Simen Kjaeraas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||simen.kja...@gmail.com
 Resolution|--- |DUPLICATE

--- Comment #2 from Simen Kjaeraas  ---


*** This issue has been marked as a duplicate of issue 7549 ***

--


[Issue 18780] Inconsistent behavior with Variant holding int converting to unsigned types

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18780

monkeywork...@hotmail.com changed:

   What|Removed |Added

 CC||monkeywork...@hotmail.com

--- Comment #1 from monkeywork...@hotmail.com ---
Looks like the problem is with std.traits.ImplicitConversionTargets:

pragma(msg, ImplicitConversionTargets!int); //(long, ulong, float, double,
real)

But it appears to be intentional. From ImplicitConversionTargets:


Note:
The possible targets are computed more conservatively than the
language allows, eliminating all dangerous conversions. For example,
`ImplicitConversionTargets!double` does not include `float`.

template ImplicitConversionTargets(T)
{
static if (is(T == bool))

else static if (is(T == int))
alias ImplicitConversionTargets =
AliasSeq!(long, ulong, CentTypeList, float, double, real);
else static if...
}

I don't know if it's better to change Variant or create a new, more permissible
version of ImplicitConversionTargets.

--


[Issue 18780] New: Inconsistent behavior with Variant holding int converting to unsigned types

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18780

  Issue ID: 18780
   Summary: Inconsistent behavior with Variant holding int
converting to unsigned types
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: alex.jercai...@gmail.com

This code works fine:
 int x = 7;
 Variant a = x;
 assert(a.convertsTo!ulong);

This assert however triggers:
 int x = 7;
 Variant a = x;
 assert(a.convertsTo!uint);

Is this behavior intended?

--


[Issue 17628] formattedWrite is impure on double

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17628

Eduard Staniloiu  changed:

   What|Removed |Added

 CC||edi33...@gmail.com

--- Comment #3 from Eduard Staniloiu  ---
Since `pureMalloc`, `pureCalloc` and `pureFree` got accepted[0], maybe we could
do the same for `sprintf` and `snprintf`?

[0] - https://github.com/dlang/druntime/pull/1836

--


[Issue 18772] [ICE] Internal error: dmd\backend\cgcod.c 607 no optimizations

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18772

uplink.co...@googlemail.com changed:

   What|Removed |Added

 CC||uplink.co...@googlemail.com

--- Comment #3 from uplink.co...@googlemail.com ---
the ice happens in alignsection, I'll see what else I can come up with.

--


[Issue 18773] Constraints on buffer re-use for std.zlib should be documented.

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18773

Eduard Staniloiu  changed:

   What|Removed |Added

   Keywords||bootcamp
 CC||edi33...@gmail.com

--


[Issue 17127] bad example code for std.concurrency.Generator

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17127

alex.jercai...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||alex.jercai...@gmail.com
 Resolution|--- |FIXED

--


[Issue 18779] New: StatsCollector empty doesn't take into account the parent allocator

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18779

  Issue ID: 18779
   Summary: StatsCollector empty doesn't take into account the
parent allocator
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: trivial
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: edi33...@gmail.com

Currently, std.experimental.allocator.building_blocks.StatsCollector does not
forward to the parent allocator, but instead, makes an assumption based on the
`bytesUsed` option.

`empty` is not the StatsCollector's decision to make, since the parent
allocator might have a different logic based on empty, than just matching
allocations with deallocations.

Please see the example below; adding the unittest in stats_collector.d will
trigger the assert

```
@system unittest
{
import std.experimental.allocator.mallocator : Mallocator;
import std.typecons : Ternary;

static struct MyAlloc
{   
pure nothrow @safe @nogc
Ternary empty()
{   
return Ternary.no;
}   

enum uint alignment = platformAlignment;
void[] allocate(size_t n) { return Mallocator.instance.allocate(n); }
bool deallocate(void[] b) { return Mallocator.instance.deallocate(b); }

static MyAlloc instance;
}   

StatsCollector!(MyAlloc, Options.all) a;
auto buf = a.allocate(42);
a.deallocate(buf);
assert(a.empty == Ternary.no); // fails
}
```

--


[Issue 18775] DMD falsely reports deprecation for deprecated implicit casts that were not used in UFCS

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18775

--- Comment #2 from FeepingCreature  ---
Same piece of code, at least.

--


[Issue 18068] No file names and line numbers in stack trace

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18068

--- Comment #9 from Seb  ---
FWIW my current guess is that its related to a "recent" change in glibc. 

This could also be related:

https://github.com/dlang/druntime/pull/2151

> The latter is how I stumbled on this. LLVM 6.0 led to DWARF v4 debuginfos, 
> rt.backtrace.dwarf doesn't support that version, so no file/line infos => 
> "??:? \0" + exception

--


[Issue 18068] No file names and line numbers in stack trace

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18068

arne.lud...@posteo.de changed:

   What|Removed |Added

 CC||arne.lud...@posteo.de

--- Comment #8 from arne.lud...@posteo.de ---
This problem doesn't seem to affect all Linux systems. So, please report your
Distribution and Kernel (type `uname -r` in shell).

Works: Linux *** 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018
x86_64 x86_64 x86_64 GNU/Linux

Fails: Linux *** 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018
x86_64 GNU/Linux

--


[Issue 18228] this(this a){} doesn't generate postblit ctor; this(this){} does

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18228

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

   What|Removed |Added

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

--


[Issue 18228] this(this a){} doesn't generate postblit ctor; this(this){} does

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18228

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

https://github.com/dlang/dmd/commit/5cebe70bd69496f129bf2284b02fbe1cbcbd3b82
Fix Issue 18228 - this(this a){} doesn't generate postblit ctor; this(this){}
does

https://github.com/dlang/dmd/commit/bbc087e67ea977de2d5f0410d306b510e4baeb92
Merge pull request #8141 from RazvanN7/Issue_18228

Fix Issue 18228 - this(this a){} doesn't generate postblit ctor; this(this){}
does
merged-on-behalf-of: Jacob Carlborg 

--


[Issue 13435] Strange error if struct is a class member and opAssign applied

2018-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13435

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

https://github.com/dlang/dmd/commit/af078566aad8dede82d57c36758a28267df07759
Fix Issue 13435 - Strange error if struct is a class member and opAssign
applied

https://github.com/dlang/dmd/commit/ee576dc6d730c7e1ab5d6b1908a453b1590efec1
Merge pull request #8191 from RazvanN7/Issue_13435

Fix Issue 13435 - Strange error if struct is a class member and opAssign
applied
merged-on-behalf-of: Jacob Carlborg 

--