[Issue 3947] Implicit and explicit casting of floating point to bool produces different results

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3947

ZombineDev  changed:

   What|Removed |Added

 CC||petar.p.ki...@gmail.com

--


[Issue 17096] New: many traits accept an invalid parameter count without error

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17096

  Issue ID: 17096
   Summary: many traits accept an invalid parameter count without
error
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

By error, if you don't know well the spec, this scenario is quite possible:


class B{final void foo(){}

enum a =__traits(isFinalFunction, B, "foo");
instead of

__traits(isFinalFunction, B.foo); // ok

--


[Issue 17095] New: Have issues with std.bigint on Ubuntu 32-bit

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17095

  Issue ID: 17095
   Summary: Have issues with std.bigint on Ubuntu 32-bit
   Product: D
   Version: D2
  Hardware: x86
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: virgil_...@yahoo.com

Using Ubuntu 14.04, x86 - DMD32 D Compiler v2.072.2

Encountered the following error when trying to compile IP2Location.d codes from 
https://github.com/ip2location/ip2location-d/blob/master/source/ip2location-d/ip2location.d

Error below:

ip2location-d 8.0.3: building configuration "library"...
/usr/include/dmd/phobos/std/internal/math/biguintx86.d(231,14): Error: asm
statements cannot be interpreted at compile time
/usr/include/dmd/phobos/std/internal/math/biguintcore.d(1758,52):called
from here: multibyteIncrementAssign(data[0..hi], cast(uint)(y & 4294967295LU))
/usr/include/dmd/phobos/std/internal/math/biguintcore.d(448,40):called
from here: biguintFromDecimal(tmp, s)
/usr/include/dmd/phobos/std/bigint.d(112,40):called from here:
this.data.fromDecimalString(filterBidirectional(codeUnits))
../../../../.dub/packages/ip2location-d-8.0.3/ip2location-d/source/ip2location-d/ip2location.d(78,47):
   called from here: BigInt(BigUint([0u]),
false).this("340282366920938463463374607431768211455")
dmd failed with exit code 1.


Have tested with Ubuntu 14.04 64-bit and it's working fine.

--


[Issue 17080] Can assign member-function-ptr to free-function-ptr

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17080

--- Comment #8 from Sprink  ---
Why bother fixing this issue by just changing the type to a delegate? You are
just making a temporary fix that has the potential to break code out there.
Then you are just going to have to cause the same breakage when the actual
underlying issue is fixed. This really shouldn't be half-assed.

If you are going to do anything, make taking the address of a member function
without an object an error. That way it'll cause the same breakage but then
people won't continue to use it and won't cause a second breakage.

--


[Issue 17094] New: std.container.binaryheap doesn't manage store length consistently when inserting

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17094

  Issue ID: 17094
   Summary: std.container.binaryheap doesn't manage store length
consistently when inserting
   Product: D
   Version: D2
  Hardware: All
   URL: http://dlang.org/
OS: All
Status: NEW
  Severity: normal
  Priority: P3
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: jrdemail2000-dl...@yahoo.com

When inserting into a BinaryHeap, the underlying data "store" length may or may
not be updated, depending the type of container used and whether there is
already capacity.

This leaves the data store in a state where cannot be used. This appears to be
a bug, described used cases indicate the store can be accessed, implying the
length should be correct.

A unit test example from the documentation:

   import std.algorithm.comparison : equal;
   int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ];
   auto h = heapify(a);
   assert(h.front == 16);
   assert(equal(a, [ 16, 14, 10, 8, 7, 9, 3, 2, 4, 1 ]));

The last line is accessing the data store. This program has the above, then
follows with the same notion, but done by inserting elements into an existing
heap instead:

void main(string[] args)
{
import std.container.binaryheap;
import std.algorithm.comparison : equal;

/* Current unit test. */
int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ];
auto h = heapify(a);
assert(h.front == 16);
assert(equal(a, [ 16, 14, 10, 8, 7, 9, 3, 2, 4, 1 ]));

/* Same, but using insert. Fails on last line. */
int[] vals = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ];
int[] b;
auto h2 = heapify(b);
foreach (v; vals) h2.insert(v);
assert(h2.front == 16);
assert(equal(b, [ 16, 14, 10, 8, 7, 9, 3, 2, 4, 1 ]));  // Fails
}

Documentation for binaryheap implies throughout that structure is being applied
to the underlying data store, and that this can be accessed.

A specific use case where this is problematic is when extracting the elements
to reorder the underlying data store. From the documentation:

Extracting elements from the BinaryHeap to completion leaves the
underlying store sorted in ascending order but, again, yields
elements in descending order.

This is useful when identifying a top-k set of elements, then want to access in
ascending order, which is the order of the data store in the description above.
However, because the data store length is not correctly set, it cannot be
accessed normally.

The below program has some diagnostics. It inserts in heaps built with both
dynamics arrays and std.container.array.Array. It also shows the difference
when capacity has and has not been preallocated.

When run, it shows that the underlying data store gets updated when an
std.container.array.Array is used and preallocated with reserve(), not
otherwise the lengths are not updated.

--bug_binaryheap.h-
void main(string[] args)
{
import std.container.binaryheap;
import std.container.array;
import std.stdio;

int[] vals = [3, 8, 9, 2, 6, 4, 5, 1, 7];
int[] storeX;
int[] storeXRes;
Array!int storeY;
Array!int storeYRes;

storeXRes.reserve(vals.length);
storeYRes.reserve(vals.length);

writeln("  X  XRes  Y  YRes");
writeln("Before heapify");
writefln("  Store capacity:%2d   %2d  %2d  %2d",
 storeX.capacity, storeXRes.capacity, storeY.capacity,
storeYRes.capacity);

auto heapX= heapify(storeX, 0);
auto heapXRes = heapify(storeXRes, 0);
auto heapY= heapify(storeY, 0);
auto heapYRes = heapify(storeYRes, 0);

writeln("After heapify");
writefln("  Heap lengths:  %2d   %2d  %2d  %2d",
 heapX.length, heapXRes.length, heapY.length, heapYRes.length);
writefln("  Store lengths: %2d   %2d  %2d  %2d",
 storeX.length, storeXRes.length, storeY.length, storeYRes.length);

writefln("  Heap capacity: %2d   %2d  %2d  %2d",
 heapX.capacity, heapXRes.capacity, heapY.capacity,
heapYRes.capacity);
writefln("  Store capacity:%2d   %2d  %2d  %2d",
 storeX.capacity, storeXRes.capacity, storeY.capacity,
storeYRes.capacity);

foreach (v; vals)
{
heapX.insert(v);
heapXRes.insert(v);
heapY.insert(v);
heapYRes.insert(v);
}

writeln("After inserts");
writefln("  Heap lengths   %2d   %2d  %2d  %2d",
 heapX.length, heapXRes.length, heapY.length, heapYRes.length);
writefln("  Store lengths: %2d   %2d  %2d  %2d",
 storeX.length, storeXRes.length, storeY.length, storeYRes.length);

writefln("  Heap capacity: %2d   %2d  %2d  %2d",
 heapX.capacity, heapXRes.capacity, heapY.capacity,
heapYRes.capacity);
writefln("  Store capacity:%2d   %2d  %2d  %2d",
 storeX.capacity, storeXRes.capacity, 

[Issue 17093] gdc compilation performance on the Raspbery Pi leaves to be desired

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17093

--- Comment #2 from Ion Todirel  ---
P.S. running Raspbian Jessie

--


[Issue 16527] extern( C++ ) Win64 build - return struct by value is broken

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16527

Sprink  changed:

   What|Removed |Added

 CC||sprink.nore...@gmail.com

--- Comment #2 from Sprink  ---
The problem is that there's no way to properly model a pointer to a member
function to C++ from D. You can't use a delegate as it isn't supported with
extern(C++). So there's no way for it to know that the parameter you are
passing is actually a "this". Taking the address of a member function without
an object is also broken (#3720).

--


[Issue 17093] gdc compilation performance on the Raspbery Pi leaves to be desired

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17093

--- Comment #1 from Ion Todirel  ---
This is a Raspberry Pi 3

--


[Issue 17093] New: gdc compilation performance on the Raspbery Pi leaves to be desired

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17093

  Issue ID: 17093
   Summary: gdc compilation performance on the Raspbery Pi leaves
to be desired
   Product: D
   Version: D2
  Hardware: Other
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: tools
  Assignee: nob...@puremagic.com
  Reporter: iontodi...@gmail.com

gdc seems much slower than gcc on Raspberry Pi, I don't know what other detail
to provide

--


[Issue 17072] [REG 2.073.0-b1] missing symbols with -inline

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17072

--- Comment #3 from Walter Bright  ---
https://github.com/dlang/dmd/pull/6452

--


[Issue 17072] [REG 2.073.0-b1] missing symbols with -inline

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17072

--- Comment #2 from Walter Bright  ---
(In reply to Rainer Schuetze from comment #0)
> This does not happen with dmd 2.072 or without -inline.

It does work if you throw -dip25. Still a regression, though.

--


[Issue 16483] ICE in expression.d from typeof

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16483

bitter.ta...@gmx.com changed:

   What|Removed |Added

 CC||bitter.ta...@gmx.com

--- Comment #2 from bitter.ta...@gmx.com ---
Covered by DMD's PR https://github.com/dlang/dmd/pull/6451

--


[Issue 15690] [ICE] backend/symbol.c 1032

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15690

b2.t...@gmx.com changed:

   What|Removed |Added

 CC||b2.t...@gmx.com

--- Comment #1 from b2.t...@gmx.com ---
This case is deprecated now, should this issue be closed then ?

--


[Issue 15734] Need this for map

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15734

b2.t...@gmx.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||b2.t...@gmx.com
 Resolution|--- |INVALID

--- Comment #3 from b2.t...@gmx.com ---
foo is a member function but map takes an alias to a function that must be
known at compile time. change definition to

static int foo(int a) { return a; }

and it works

--


[Issue 16483] ICE in expression.d from typeof

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16483

b2.t...@gmx.com changed:

   What|Removed |Added

 CC||b2.t...@gmx.com

--- Comment #1 from b2.t...@gmx.com ---
As a workaround it's possible to mark the free function as "static".
There's a more interesting error message with this similar example:

struct S
{
enum a = bar!(x=>x)(true);
}

/*static*/ bool bar(alias foo)(bool b)
{
return foo(b);
}
--


[Issue 17055] this(...) hides this() of mixed in template

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17055

b2.t...@gmx.com changed:

   What|Removed |Added

 CC||b2.t...@gmx.com

--- Comment #1 from b2.t...@gmx.com ---
minimal example ?

--


[Issue 15603] ICE in cgxmm.c 647

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15603

b2.t...@gmx.com changed:

   What|Removed |Added

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

--


[Issue 17072] [REG 2.073.0-b1] missing symbols with -inline

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17072

Martin Nowak  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com,
   ||c...@dawg.eu

--- Comment #1 from Martin Nowak  ---
There is a difference between the mangling of the symbol included in
phobos64.lib and the one requested.

phobos64.lib has:
_D4core4time8Duration46__T10opOpAssignVAyaa1_2dTS4core4time8DurationZ10opOpAssignMFNaNbNcNiNjNfxS4core4time8DurationZS4core4time8Duration
linker wants:
_D4core4time8Duration46__T10opOpAssignVAyaa1_2dTS4core4time8DurationZ10opOpAssignMFNaNbNcNiNfxS4core4time8DurationZS4core4time8Duration

ddemangle doesn't yet know Nj, it stands for FuncAttrReturn
(https://dlang.org/spec/abi.html#FuncAttrReturn).

So what we have here is likely a difference in return inference in different
compilations, leading the test below to think that the template was already
instantiated by druntime, therefor not emitting it itself, but the
instantiation in druntime inferred a different STCreturn.

It's only reproducible w/ -inline b/c that runs semantic3 on imported functions
and templates.

Happens because the released library is build with -dip25 which enables return
inference and obviously creates ABI incompatibilities.

--


[Issue 17092] [REG 2.069.0] cannot get frame pointer from TaskPool.reduce

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17092

Iain Buclaw  changed:

   What|Removed |Added

Summary|[REG 2.069.0] cannot access |[REG 2.069.0] cannot get
   |frame pointer of|frame pointer from
   |MapResult!(__lambda1,   |TaskPool.reduce
   |Result).MapResult   |

--


[Issue 17092] [REG 2.069.0] cannot access frame pointer of MapResult!(__lambda1, Result).MapResult

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17092

--- Comment #1 from Iain Buclaw  ---
(Edited title to match DMD's error message)

/usr/include/dmd/phobos/std/parallelism.d(2632): Error: function
std.parallelism.TaskPool.reduce!"a + b".reduce!(MapResult!(delegate (int i) =>
1.0 / (1.0 + x * x), Result)).reduce cannot get frame pointer to D main

--


[Issue 17092] [REG 2.069.0] cannot access frame pointer of MapResult!(__lambda1, Result).MapResult

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17092

Iain Buclaw  changed:

   What|Removed |Added

   Hardware|x86_64  |All

--


[Issue 17092] [REG 2.069.0] cannot access frame pointer of MapResult!(__lambda1, Result).MapResult

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17092

Iain Buclaw  changed:

   What|Removed |Added

 CC||ibuc...@gdcproject.org
 OS|Linux   |All
   Severity|enhancement |regression

--


[Issue 17092] New: [REG 2.069.0] cannot access frame pointer of MapResult!(__lambda1, Result).MapResult

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17092

  Issue ID: 17092
   Summary: [REG 2.069.0] cannot access frame pointer of
MapResult!(__lambda1, Result).MapResult
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

>From gdc's own testsuite, this stopped being compilable from 2.069 and onwards.
---
void main()
{
import std.algorithm : map;
import std.parallelism : taskPool;
import std.range : iota;

immutable n = 1;
immutable delta = 1.0 / n;
immutable pi = 4.0 * delta * taskPool.reduce!"a + b"(
map!((int i) { immutable x = (i - 0.5) * delta; return 1.0 / (1.0 + x *
x); })(iota(n)));
}
---

Introduced by: https://github.com/dlang/phobos/pull/3522

Emplacing `RTask.init` instead of `RTask()` fixes the compiler error, however,
as per comment in PR:

task[] = RTask.init; has two bugs:

1. RTask is a nested struct, so RTask.init contains null context pointer.
2. That is a block assignment, so there is a possibility to call RTask.~this()
on garbage objects (stack allocated buf is initialized by void).

I'm not totally convinced that (1) is a problem however.

--


[Issue 17091] std.range.zip cannot "save" correctly

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17091

--- Comment #1 from Kazuki Komatsu  ---
(In reply to Kazuki Komatsu from comment #0)
> Following code cannot be done correctly.
> I tested the following code on DMDv2.072.2.
> The line of the 4th `writeln` should output "[Tuple!(int, int)(1, 4),
> Tuple!(int, int)(2, 5), Tuple!(int, int)(3, 6)]".
> 
> 
> import std.range;
> import std.algorithm;
> import std.stdio;
> 
> void main()
> {
> auto s1 = [1, 2, 3].inputRangeObject;
> auto s2 = [4, 5, 6].inputRangeObject;
> 
> writeln(s1.save);   // [1, 2, 3], OK
> writeln(s2.save);   // [1, 2, 3], OK
> 
> auto added = s1.zip(s2);
> writeln(zs.save);   // [Tuple!(int, int)(1, 4), Tuple!(int, int)(2, 5),
> Tuple!(int, int)(3, 6)], OK
> writeln(zs.save);   // [], NG
> }
> 

Sorry, `auto added = s1.zip(s2);` is wrong.
The correct code is following one


import std.range;
import std.algorithm;
import std.stdio;

void main()
{
auto s1 = [1, 2, 3].inputRangeObject;
auto s2 = [4, 5, 6].inputRangeObject;

writeln(s1.save);   // [1, 2, 3], OK
writeln(s2.save);   // [1, 2, 3], OK

auto zs = s1.zip(s2);
writeln(zs.save);   // [Tuple!(int, int)(1, 4), Tuple!(int, int)(2, 5),
Tuple!(int, int)(3, 6)], OK
writeln(zs.save);   // [], NG
}


--


[Issue 17091] New: std.range.zip cannot "save" correctly

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17091

  Issue ID: 17091
   Summary: std.range.zip cannot "save" correctly
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: critical
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: enjouzensyou.bo...@gmail.com

Following code cannot be done correctly.
I tested the following code on DMDv2.072.2.
The line of the 4th `writeln` should output "[Tuple!(int, int)(1, 4),
Tuple!(int, int)(2, 5), Tuple!(int, int)(3, 6)]".


import std.range;
import std.algorithm;
import std.stdio;

void main()
{
auto s1 = [1, 2, 3].inputRangeObject;
auto s2 = [4, 5, 6].inputRangeObject;

writeln(s1.save);   // [1, 2, 3], OK
writeln(s2.save);   // [1, 2, 3], OK

auto added = s1.zip(s2);
writeln(zs.save);   // [Tuple!(int, int)(1, 4), Tuple!(int, int)(2, 5),
Tuple!(int, int)(3, 6)], OK
writeln(zs.save);   // [], NG
}


--


[Issue 6227] Comparison of different enums

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6227

bitter.ta...@gmx.com changed:

   What|Removed |Added

 CC||bitter.ta...@gmx.com

--- Comment #2 from bitter.ta...@gmx.com ---
Covered by DMD's PR https://github.com/dlang/dmd/pull/6444

--


[Issue 6400] opDispatch with WithStatement

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6400

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

https://github.com/dlang/dmd/commit/2c8008781a23f807be89dfaf858814a1308c9f43
Fix issue 6400 - Better interaction between with() and opDispatch

https://github.com/dlang/dmd/commit/c49fb860d507f75556cfb2108986a8b901d15920
Merge pull request #6439 from LemonBoy/b6400

Fix issue 6400 - Better interaction between with() and opDispatch

--


[Issue 6400] opDispatch with WithStatement

2017-01-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6400

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

   What|Removed |Added

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

--