[Issue 18245] New: Segfault on std.math.nearbyint

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18245

  Issue ID: 18245
   Summary: Segfault on std.math.nearbyint
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ru...@rumbu.ro

If there is no alternative, make function unavailable on Windows 64 bit instead
of using a 0 assertion.

real nearbyint(real x) @trusted nothrow @nogc
{
version (CRuntime_Microsoft)
{
assert(0);  // not implemented in C library
}
else
return core.stdc.math.nearbyintl(x);
}

--


[Issue 18214] TemplateOf should return void for non-templated symbols

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18214

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

   What|Removed |Added

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

--


[Issue 18230] multiwayUnion sets wrong pred lambdas

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18230

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

https://github.com/dlang/phobos/commit/a4cd3a65428f9d1a4174f791a64a054ef8e5e214
Fix Issue 18230 - multiwayUnion sets wrong pred lambdas

https://github.com/dlang/phobos/commit/17fbc92d59d06d2ac3dac50c97ae304baa57bbb0
Merge pull request #6032 from RazvanN7/Issue_18230

Fix Issue 18230 - multiwayUnion sets wrong pred lambdas
merged-on-behalf-of: Andrei Alexandrescu 

--


[Issue 18244] Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

--- Comment #3 from Răzvan Ștefănescu  ---
NaN assumes that you want to create a real nan;

The correct signature will be in my opinion:

NaN(F, T)(const T payload)
if (isFloatingPoint!T && isUnsigned!T)

This will allow to create float or double NaNs.


Ref abs: I don't understand exactly why we have abs and fabs. I think that
dropping "fabs" and specializing "abs" for each numeric type is a better
approach.

--


[Issue 18214] TemplateOf should return void for non-templated symbols

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18214

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

https://github.com/dlang/phobos/commit/997f4fe64a19814e63ee30427e811a8116d4e4f8
Fix Issue 18214 - TemplateOf should return void for non-templated symbols

https://github.com/dlang/phobos/commit/9fe884ddaf0eb3b6d83c5339ada755922a0d9d2b
Merge pull request #6016 from wilzbach/fix-18214

Fix Issue 18214 - TemplateOf should return void for non-templated symbols
merged-on-behalf-of: MetaLang 

--


[Issue 18246] New: [spec] "arithmetic type", not defined in https://dlang.org/spec/traits.html

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18246

  Issue ID: 18246
   Summary: [spec] "arithmetic type", not defined in
https://dlang.org/spec/traits.html
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dlang.org
  Assignee: nob...@puremagic.com
  Reporter: hst...@quickfur.ath.cx

On https://dlang.org/spec/traits.html, section 25.1, __traits(isArithmetic, T)
is defined as returning true if T is an arithmetic type.  However, what exactly
constitutes an arithmetic type is not stated.  Are pointers considered
arithmetic types, since D does have pointer *arithmetic*?

It would be best if the spec explicitly listed exactly which types are
considered "arithmetic types", or for that matter "unsigned types", etc.,
rather than leaving it up to interpretation.

--


[Issue 18244] Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

--- Comment #5 from hst...@quickfur.ath.cx ---
W.r.t NaN, I agree it would be nice to be able to specify the exact type
desired. I don't think the payload has to be a template parameter; it should
just be ulong since all unsigned integral types will convert to ulong, and we
can just take however many bits to fit into the payload of the requested type.

Again, I think this belongs in a separate issue so that it doesn't get lost
amid the overloading issues.

--


[Issue 18244] Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

hst...@quickfur.ath.cx changed:

   What|Removed |Added

 CC||hst...@quickfur.ath.cx

--- Comment #1 from hst...@quickfur.ath.cx ---
`NaN` is not a template. Are you sure it should be on this list? :)

--


[Issue 15929] First sentence to https://dlang.org/library/std/range/primitives.html points to invalid link https://dlang.org/library/std/range/std_range.html

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15929

Andrei Alexandrescu  changed:

   What|Removed |Added

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

--- Comment #2 from Andrei Alexandrescu  ---
Ali, yes, if you try to reproduce and things are working, please close as FIXED
or WORKSFORME. I think in this case FIXED is more appropriate. I'll do the
honors here, thanks!!

--


[Issue 18230] multiwayUnion sets wrong pred lambdas

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18230

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

   What|Removed |Added

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

--


[Issue 15929] First sentence to https://dlang.org/library/std/range/primitives.html points to invalid link https://dlang.org/library/std/range/std_range.html

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15929

Ali Ak  changed:

   What|Removed |Added

 CC||ali.akhtarz...@gmail.com

--- Comment #1 from Ali Ak  ---
Is it ok for anyone to just mark issues as resolved in cases like these or?

--


[Issue 17440] Nullable.nullify() resets referenced object

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17440

--- Comment #13 from Chris Paulson-Ellis  ---
Perhaps it would be helpful to reiterate one of my comments from my original
forum thread linked in comment 8...


For those confused as to why you'd want to wrap a Nullable around something
that already has nullable semantics, it's mostly about making APIs that
explicitly declare their optional return values. See:
http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html


If Phobos needs a new Maybe/Optional template - perhaps specialised for class
types - then so be it, but at the moment Nullable is it.

--


[Issue 17970] shared struct destructor doesn't compile anymore

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17970

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

   What|Removed |Added

 CC||alex.jercai...@gmail.com

--- Comment #2 from alex.jercai...@gmail.com ---
 shared struct Foo
 {
 ~this()
 {
 }
 }

 void main()
 {
 Foo x;
 }

This still does not compile

--


[Issue 17440] Nullable.nullify() resets referenced object

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17440

--- Comment #14 from Chris Paulson-Ellis  ---
Also - to emphasise what was said in comment 11 - let me just say that it took
me *3 days* to find that the cause of a mysterious crash in my code was the
destroy in nullify().

At the very least, the documentation for Nullable should contain a prominent
warning that nullify() will invalidate your class references.

--


[Issue 18079] rdmd does not discover all dependencies

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18079

Jonathan Marler  changed:

   What|Removed |Added

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

--- Comment #2 from Jonathan Marler  ---
https://github.com/dlang/tools/pull/271

--


[Issue 18040] rdmd --exclude= --include= should allow passing in modules (not just packages)

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18040

Jonathan Marler  changed:

   What|Removed |Added

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

--- Comment #2 from Jonathan Marler  ---
https://github.com/dlang/tools/pull/271

--


[Issue 18042] rdmd ignores --exclude when -deps is provided

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18042

Jonathan Marler  changed:

   What|Removed |Added

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

--- Comment #2 from Jonathan Marler  ---
Fixed with: https://github.com/dlang/tools/pull/271

--


[Issue 15798] std.algorithm.mutation.copy takes target by value

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15798

Jack Stouffer  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #2 from Jack Stouffer  ---
To be honest, the behavior of copy really only makes sense for array targets.
It doesn't make any sense to return the "remainder" of a generic output range.

copying to non-arrays should be deprecated

--


[Issue 17440] Nullable.nullify() resets referenced object

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17440

hst...@quickfur.ath.cx changed:

   What|Removed |Added

   Keywords||pull

--- Comment #15 from hst...@quickfur.ath.cx ---
https://github.com/dlang/phobos/pull/6038

--


[Issue 18243] selective import + overload = private visibility

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18243

Seb  changed:

   What|Removed |Added

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

--- Comment #2 from Seb  ---


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

--


[Issue 17630] selective imports find symbols in private imports of other modules

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17630

Seb  changed:

   What|Removed |Added

 CC||ru...@rumbu.ro

--- Comment #5 from Seb  ---
*** Issue 18243 has been marked as a duplicate of this issue. ***

--


[Issue 18244] Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

hst...@quickfur.ath.cx changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from hst...@quickfur.ath.cx ---
https://github.com/dlang/phobos/pull/6040

Note that currently I'm not touching abs() because the sig constraint is just
too complex.

--


[Issue 18244] Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

--- Comment #4 from hst...@quickfur.ath.cx ---
Huh. I'm surprised there's such a thing as fabs in std.math. :-P

I agree that we should just unify everything under abs(). This is not C, where
we can't overload abs() for integer vs. float arguments.  Of course, fabs can
still be left as an alias to abs() for backward compatibility.

We should probably file a separate bug to track this issue.

--


[Issue 11951] formattedWrite should take OutputRange should be ref parameter

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11951

Jack Stouffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||j...@jackstouffer.com
 Resolution|--- |FIXED

--- Comment #1 from Jack Stouffer  ---
Fixed with https://github.com/dlang/phobos/pull/5648

--


[Issue 18248] New: radix overload of std.conv.parse fails to throw on non-empty range without number

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18248

  Issue ID: 18248
   Summary: radix overload of std.conv.parse fails to throw on
non-empty range without number
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: issues.dl...@jmdavisprog.com

Per the documentation for std.conv.parse, parse is supposed to throw if "no
character of the input was meaningfully converted." The main overload of parse
does this, and the radix overload does if it's given a radix of 10 (since that
just calls the main overload) or if the range is empty. However, if you pass it
a radix other than 10 and string that is not empty but which does not start
with a number, it returns 0 on failure instead of throwing. e.g. this code 
should throw


void main()
{
import std.conv;
auto str = ";";
assert(str.parse!uint(16) == 0); // should throw
assert(str == ";");

}


However, it passes.

--


[Issue 16431] rdmd runs dmd twice for single-files with no dependencies

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16431

Jonathan Marler  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Jonathan Marler  ---
https://github.com/dlang/tools/pull/271

--


[Issue 18247] New: core.stdc.math functions that never set errno should be pure

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18247

  Issue ID: 18247
   Summary: core.stdc.math functions that never set errno should
be pure
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: n8sh.second...@hotmail.com

core.stdc.math functions that never set errno should be pure. These include:

* cos, sin, tan, atan;
* tanh, asinh;
* frexp, modf;
* cbrt;
* erf;
* ceil, floor, trunc, round, rint, nearbyint;
* copysign, nan;
* fdim, fmax, fmin;
* fabs, abs, fma;
* fpclassify, isfinite, isinf, isnan, isnormal, signbit;
* isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered.

--


[Issue 15798] std.algorithm.mutation.copy takes target by value

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15798

--- Comment #3 from Jack Stouffer  ---
https://github.com/dlang/phobos/pull/6039

--


[Issue 18229] Misleading documentation of std.process.environment.get

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18229

Steven Schveighoffer  changed:

   What|Removed |Added

   Keywords||ddoc
 CC||schvei...@yahoo.com
   Hardware|x86_64  |All
 OS|Linux   |All
   Severity|enhancement |trivial

--- Comment #1 from Steven Schveighoffer  ---
Hm... I think it means it doesn't throw when the variable doesn't exist (as
opIndex does). But it does throw if the name being searched for is invalid.

Definitely I think this is a doc issue.

--


[Issue 18096] Add fold() to std.parallelism

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18096

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

   What|Removed |Added

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

--


[Issue 18096] Add fold() to std.parallelism

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18096

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

https://github.com/dlang/phobos/commit/c472b2303d172226b9bf250d0d0567561c766e20
Fix Issue 18096 - Add fold() to std.parallelism

https://github.com/dlang/phobos/commit/fa0a6192a14e628f73f999b0547f128f6f8f4e5e
Merge pull request #5951 from acehreli/TaskPool_fold

Fix Issue 18096 - Add fold() to std.parallelism
merged-on-behalf-of: Sebastian Wilzbach 

--


[Issue 17440] Nullable.nullify() resets referenced object

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17440

Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com

--


[Issue 3720] Taking address of member functions possible without an instance

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720

MichaelZ  changed:

   What|Removed |Added

 CC||dlang@bregalad.de

--


[Issue 18249] New: pragma decoration skips documentation

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18249

  Issue ID: 18249
   Summary: pragma decoration skips documentation
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ru...@rumbu.ro

/**
 * Some documentation
 */
pragma(inline, true);
void myDocumentedFunction() {}

No documentation is generated for myDocumentedFunction

--


[Issue 3720] Taking address of member functions possible without an instance

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3720

FeepingCreature  changed:

   What|Removed |Added

 CC||default_357-l...@yahoo.de

--- Comment #15 from FeepingCreature  ---
Here's a subset of this that should be fixed immediately:

class S {
  void fun() { }
  static void function() fun2() { return  }
}

There is *no* good reason to allow this, because you can always do 
explicitly. This looks *way* too innocuous for the horror that it is.

--


[Issue 18243] New: selective import + overload = private visibility

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18243

  Issue ID: 18243
   Summary: selective import + overload = private visibility
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: blocker
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ru...@rumbu.ro

module a;

private import std.math: isNaN;

//custom overload
public bool isNaN(int i) { return false; }


=

module b;
import a;

void foo()
{
bool b = isNaN(float.nan);
//compiles successfully calling std.math.isNaN even it should not be
visible.
}

--


[Issue 18243] selective import + overload = private visibility

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18243

--- Comment #1 from Răzvan Ștefănescu  ---
See also: https://issues.dlang.org/show_bug.cgi?id=12359

--


[Issue 18244] New: Generic functions in std.math cannot be overloaded

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18244

  Issue ID: 18244
   Summary: Generic functions in std.math cannot be overloaded
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: blocker
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ru...@rumbu.ro

There are functions in std.math accepting any parameter type instead of being
specialized on numeric types. 

This blocks overloading of such functions for other custom numeric types as
long as the end user imports std.math.

List of generic functions:

approxEqual
isFinite
isNormal
isSubnormal
NaN
nextafter
signbit
sgn

Special case: "abs" assumes wrongly that the comparison operator is pure @safe
nothrow @nogc for any imaginable type which supports T.init < 0;

--


[Issue 255] Odd performance difference w/ complex doubles.

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=255

Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #4 from Andrei Alexandrescu  ---
Adapted the code to the current D compiler, here's the code:

=
import std.stdio, std.string;
void main(char[][] args)
{
  char  bit_num = 0, byte_acc = 0;
  const int iter = 50;
  const double lim = 2.0 * 2.0;
version(foo)
{
  cdouble Z, C;
}
 import core.stdc.stdlib;

  int n = atoi(args[1].toStringz);

  writefln("P4\n%d %d",n,n);

  for(int y=0; y lim) ? 0x00:0x01));

   bit_num++;
   if(bit_num == 8)
   {
   //putc(byte_acc,core.stdc.stdio.stdout);
   bit_num = byte_acc = 0;
   }
   else if(x == n-1)
   {
   byte_acc  <<= (8-n%8);
   //putc(byte_acc,core.stdc.stdio.stdout);
   bit_num = byte_acc = 0;
   }
}
}

double norm(cdouble C)
{
return C.re*C.re + C.im*C.im;
}
=

Then built two versions like this (file is test.d):

=
$ dmd -O -inline -release -version=foo -oftestfoo test
$ dmd -O -inline -release test
=

Then I measured like this:

=
$ time ./testfoo 1
P4
1 1
./testfoo 1  17.70s user 0.00s system 99% cpu 17.704 total
$ time ./test 1
P4
1 1
./test 1  17.71s user 0.00s system 99% cpu 17.714 total
=

I'll close this as "works for me", please reopen if I missed something. Thanks!

--


[Issue 16490] Usage of attributes in inline asm blocks is not documented

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16490

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

https://github.com/dlang/dlang.org/commit/cedefe6bc1afe192d393fc06199f244e3e611cf1
fix issue 16490 -  Usage of attributes in inline asm blocks is not documented

https://github.com/dlang/dlang.org/commit/853b2aebd4439dd5c53f642f543a148100ddf12e
Merge pull request #2037 from BBasile/issue-16490

fix issue 16490 -  Usage of attributes in inline asm blocks is not documented

--


[Issue 1985] import expression should return ubyte[] not string

2018-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1985

--- Comment #10 from hst...@quickfur.ath.cx ---
The compiler has no way to know whether an imported file is even text to begin
with. For all you know, the code could be:


auto logo = import("logo.png"); // embed image inside executable


It's not the compiler's job to decode the contents of arbitrary files. Let
import(filename) return ubyte[], and let the user code decide what to do with
it.

--