[Issue 18407] debug should escape nothrow, @nogc, @safe (not just pure)

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18407

--- Comment #2 from Timothee Cour  ---
workaround suggested here by Adam Ruppe:
 https://forum.dlang.org/post/ojgxdtqodcamkqcrx...@forum.dlang.org
```
void foo() {}

@trusted nothrow @nogc void da(scope void delegate() a) {
auto hack = cast(void delegate() @nogc) a;
try
hack();
catch(Exception e)
assert(0, e.msg);
}

@safe nothrow @nogc pure void main() {
debug da({foo();});
}
```

--


[Issue 18407] debug should escape nothrow, @nogc, @safe (not just pure)

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18407

--- Comment #1 from Timothee Cour  ---
related forum threads:
* option -ignore_pure for temporary debugging (or how to wrap an unpure
function inside a pure one)?
* Should debug{} allow GC?
* Debug prints in @nogc

--


[Issue 18407] New: debug should escape nothrow @nogc safe (not just pure)

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18407

  Issue ID: 18407
   Summary: debug should escape nothrow @nogc safe (not just pure)
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: major
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: timothee.co...@gmail.com

```
void fun_nogc()@nogc{
  debug{
auto a1=new int(1); // Error: cannot use 'new' in @nogc function 'main.fun'
  } 
}

void fun_nothrow() nothrow{
  debug{
static int a;
import std.exception;
enforce(a==0);  //  Error: function std.exception.enforce!(Exception,
bool).enforce is not nothrow
  } 
}

static int temp(){
  static int a=0;
  a++;
  return a;
}

int fun_pure() pure{
  int ret;

  debug{
ret+=temp;  // ok this works
static int a2=0;
a2++;
ret+=a2;
  }
  return ret;
}

void fun_safe() @safe{
  debug{
int []a=[1];
if(false) a.ptr[0]++; // Error: a.ptr cannot be used in @safe code, use
[0] instead
  }
}

void main(){
  fun_nogc;
  fun_nothrow;
  fun_pure;
  fun_safe;
}

```

--


[Issue 18407] debug should escape nothrow, @nogc, @safe (not just pure)

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18407

Timothee Cour  changed:

   What|Removed |Added

 CC||timothee.co...@gmail.com
Summary|debug should escape nothrow |debug should escape
   |@nogc safe (not just pure)  |nothrow, @nogc, @safe (not
   ||just pure)

--


[Issue 18406] __traits( getOverloads ) doesn't accept module symbols as its aggregate parameter

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18406

Ethan Watson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Ethan Watson  ---
Turns out I'm just a rookie. You need to stringify the final parameter if
necessary...

--


[Issue 18406] New: __traits( getOverloads ) doesn't accept module symbols as its aggregate parameter

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18406

  Issue ID: 18406
   Summary: __traits( getOverloads ) doesn't accept module symbols
as its aggregate parameter
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: goober...@gmail.com

Created attachment 1680
  --> https://issues.dlang.org/attachment.cgi?id=1680=edit
Code example

>From the documentation, "The first argument is an aggregate (e.g.
struct/class/module)."

This gets further complicated when doing an allMembers pass of a module with an
overloaded function - the function symbol will show up multiple times, but
since you cannot get the overloads you can only resolve the first overload
encountered by the compiler.

Code example attached. Uses __traits( parent ) to get the module symbol. Other
methods of obtaining the symbol, such as mixing in the name and assigning to an
alias, result in the exact same error.

Expected result: NumOverloads gets the value 2 assigned to it
Actual result: Error message: expression expected as second argument of
__traits getOverloads

--


[Issue 18351] integrate dub changelog with changed.d tool

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18351

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

https://github.com/dlang/dlang.org/commit/161730855cf247fb9f0d6bfd2860a90d419d397d
Issue 18351 - integrate dub changelog with changed.d tool

https://github.com/dlang/dlang.org/commit/4480f07026312738a1aeb23ff3dfb88af53b4b61
Merge pull request #2163 from wilzbach/18351

Issue 18351 - integrate dub changelog with changed.d tool
merged-on-behalf-of: Vladimir Panteleev 

--


[Issue 519] Invariant not called from autogenerated class/struct constructor/destructor

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=519

--- Comment #19 from Walter Bright  ---
Rebooted as: https://github.com/dlang/dmd/pull/7536/

--


[Issue 14964] __traits(isAlias, foo)

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14964

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #6 from Walter Bright  ---
I see this is a feature that could lead to a lot of unforeseen consequences.
The language semantics very much rely on an alias being indistinguishable from
the target.

As for the size_t example, it's not even possible to serialize it as a size_t.
It will go out as int or long. Name mangle a size_t, and there is no size_t
mangling, it's int or long.

> __traits(getAllMembers, funcs)

Perhaps a better solution is to have getAllMembers ignore aliases, as aliases
are members only for the purpose of symbol lookup.

--


[Issue 18405] New: std.getopt should support std.typecons.Flag out of the box

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18405

  Issue ID: 18405
   Summary: std.getopt should support std.typecons.Flag out of the
box
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: bootcamp
  Severity: enhancement
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: greensunn...@gmail.com

I know that the following works already:

---
import std.getopt, std.typecons, std.stdio;
void main()
{
auto args = ["foo", "-u"];
alias U =Flag!"foo";
U flag = U.no;
getopt(args, "u", { flag = U.yes; }, );
flag.writeln;
}
---

https://run.dlang.io/is/46u8Rx


But Flag is such a common type and "built-in" in Phobos, s.t. getopt should
really support it.

--


[Issue 18398] std.datetime.stopwatch documented examples could be better

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18398

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

https://github.com/dlang/phobos/commit/602c3ede713e626cc0147f81db24cfaaf426e060
Issue 18398 - std.datetime.stopwatch documented examples could be better

https://github.com/dlang/phobos/commit/7c1e10d82f5d71a85fda1a7936751574318739e0
Merge pull request #6139 from n8sh/issue-18398-stopwatch-doc

Issue 18398 - std.datetime.stopwatch documented examples could be better
merged-on-behalf-of: Sebastian Wilzbach 

--


[Issue 18404] New: Allow selective printing of -vgc output

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18404

  Issue ID: 18404
   Summary: Allow selective printing of -vgc output
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: bachm...@yahoo.com

It is not practical to use -vgc to catch accidental gc allocations.

Based on this post:
https://www.reddit.com/r/programming/comments/7vw0gj/vanquish_forever_these_bugs_that_blasted_your/dtygfde/

"If you use no GC at all, anywhere, it can be helpful, yes.

If you rarely use GC (e.g: when throwing exceptions, because D makes it very
inconvenient not to use GC there, and it's less important), then you will
always get that as noise that's hard to filter out."

The user should have a way to exclude printing of some of the warnings.

--


[Issue 18403] [REG2.078.2] Access violation when dmd tries to print highlighted code

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18403

ag0ae...@gmail.com changed:

   What|Removed |Added

   Keywords||ice
 CC||ag0ae...@gmail.com
Summary|Access violation when   |[REG2.078.2] Access
   |deprecated feature  |violation when dmd tries to
   |encountered |print highlighted code

--- Comment #1 from ag0ae...@gmail.com ---
Also happens on other errors. Seems to be related to code highlighting via
backticks in the error message.

For example, a source file that's just "foo" also fails. But this works as
expected even though it prints a deprecation message (but it doesn't have
highlighted code):


void main() { shared int x; ++x; }


Never fails when dmd is invoked with `-color=off`.

The diff between 2.078.1 and 2.078.2 is really small [1], and I can't spot
anything that's related to code highlighting.


[1] https://github.com/dlang/dmd/compare/v2.078.1...v2.078.2

--


[Issue 18403] New: Access violation when deprecated feature encountered

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18403

  Issue ID: 18403
   Summary: Access violation when deprecated feature encountered
   Product: D
   Version: D2
  Hardware: x86
OS: Windows
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: nay...@abv.bg

Hello everyone and excuse me for everything wrong with this thread,
I upgraded the dmd from version 2.078.1 to 2.078.2. Everything was working
correctly in 2.078.1, but now my project won't build with 2.078.2, the dmd
compiler exits with this message
E:\bugtest>dub build
Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for x86.
bugtest ~master: building configuration "application"...
source\app.d(4,4): Deprecation:
object.Error@(0): Access Violation

0x0065445A
0x006548FE
0x0064DBD3
0x0064DE3F
C:\D\dmd2\windows\bin\dmd.exe failed with exit code 1.

E:\bugtest>

Minimal reproduction example:
void main()
{
ushort i;
i=~i;
}


Yes, i'm using a feature which was deprecated.
Again, excuse me if there is something wrong with this bug report

--


[Issue 18402] New: rdmd: make -f posix.mak -j8 test => core.exception.AssertError@rdmd_test.d(373): Assertion failure

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18402

  Issue ID: 18402
   Summary: rdmd: make -f posix.mak -j8 test =>
core.exception.AssertError@rdmd_test.d(373): Assertion
failure
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: normal
  Priority: P1
 Component: tools
  Assignee: nob...@puremagic.com
  Reporter: timothee.co...@gmail.com

--


[Issue 18401] New: Auto-generate rdmd man page + HTML documentation

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18401

  Issue ID: 18401
   Summary: Auto-generate rdmd man page + HTML documentation
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: tools
  Assignee: nob...@puremagic.com
  Reporter: greensunn...@gmail.com

These pages have a tendency to get outdated:

https://github.com/dlang/tools/blob/master/man/man1/rdmd.1
https://dlang.org/rdmd.html

We should generate them like we do for dmd.

They are even outdated atm - search for `--shebang` on the man page.

--


[Issue 18400] New: Add an man page for ddemangle

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18400

  Issue ID: 18400
   Summary: Add an man page for ddemangle
   Product: D
   Version: D2
  Hardware: All
OS: Linux
Status: NEW
  Keywords: bootcamp
  Severity: enhancement
  Priority: P1
 Component: tools
  Assignee: nob...@puremagic.com
  Reporter: greensunn...@gmail.com

See also: https://github.com/dlang/dmd/tree/master/docs and
https://github.com/dlang/tools/blob/master/man/man1/rdmd.1

--


[Issue 18388] std.experimental.logger slow performance

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18388

--- Comment #3 from Arun Chandrasekaran  ---
(In reply to anonymous4 from comment #2)
> AFAIK, default logger implementations are simplistic and are not meant to be
> very fast. Fast logging requires a bit of design and is supposed to be 3rd
> party library, while std.experimental.logger provides a way to integrate it.

Thanks, but that's weird. If that's the case, why would anyone want to use
std.experimental.logger after all? Everyone will default to using their own
logger implementations not derived out of std.experimental.logger, knowing that
it is *slow*. I'm pretty sure that's not the goal of Phobos. May be something
was overlooked in the design or implementation that causes this slowness?

--


[Issue 16685] template instantiation rejected when passing member of enum struct in value parameter

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16685

Nick Treleaven  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||n...@geany.org
 Resolution|--- |FIXED

--


[Issue 17752] Switch skips over declaration issued for explicitly uninitialized variables

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17752

Martin Krejcirik  changed:

   What|Removed |Added

 CC||m...@krej.cz
   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=16578

--


[Issue 16578] bogus deprecation - switch skips declaration of variable

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16578

Martin Krejcirik  changed:

   What|Removed |Added

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

--


[Issue 18397] Poor implementation of std.conv.hexString results in unintended bloat

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18397

Steven Schveighoffer  changed:

   What|Removed |Added

Summary|Poor implementation of  |Poor implementation of
   |std.conf.hexString results  |std.conv.hexString results
   |in unintended bloat |in unintended bloat

--


[Issue 16472] Spurious "is used as a type" when aliasing enum template as default parameter

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16472

Nick Treleaven  changed:

   What|Removed |Added

 CC||n...@geany.org
Summary|Spurious "is used as a  |Spurious "is used as a
   |type" when using enum   |type" when aliasing enum
   |template member as default  |template as default
   |parameter   |parameter

--- Comment #1 from Nick Treleaven  ---
Reduced:

enum e() = 0;

template t(alias v = e!()) {} //Error
alias dummy = t!();

No error if you define `t` without `alias`:

template t(int v = e!()) {} //OK

--


[Issue 14722] Improve " is used as a type" error message

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14722

Nick Treleaven  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||n...@geany.org
 Resolution|--- |FIXED

--- Comment #1 from Nick Treleaven  ---
My recently merged pull fixes this, now you should see:

Error: template class `test.Foo()` is used as a type without instantiation; to
instantiate it use `Foo!(arguments)`

https://github.com/dlang/dmd/pull/7769

--


[Issue 18399] src/core/simd.d(53): Deprecation: 32 byte vector types are only supported with -mcpu=avx

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18399

Seb  changed:

   What|Removed |Added

 CC||greensunn...@gmail.com

--- Comment #1 from Seb  ---
See also: https://github.com/dlang/druntime/pull/1982

--


[Issue 18399] New: src/core/simd.d(53): Deprecation: 32 byte vector types are only supported with -mcpu=avx

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18399

  Issue ID: 18399
   Summary: src/core/simd.d(53): Deprecation: 32 byte vector types
are only supported with -mcpu=avx
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: regression
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: timothee.co...@gmail.com

getting this deprecation in git master druntime

src/core/simd.d(53): Deprecation: 32 byte vector types are only supported with
-mcpu=avx

--


[Issue 12708] DMD threaded code running slower than single-threaded code

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12708

Atila Neves  changed:

   What|Removed |Added

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

--


[Issue 18273] Better C: wrong exit code from main()

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18273

--- Comment #1 from Walter Bright  ---
https://github.com/dlang/dmd/pull/7851

--


[Issue 18397] Poor implementation of std.conf.hexString results in unintended bloat

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18397

--- Comment #3 from anonymous4  ---
Why it creates sting literal instead of string itself?
Then you could just do
---
enum string hexString = hexStrImpl(hexData);
---

--


[Issue 18398] std.datetime.stopwatch documented examples could be better

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18398

--- Comment #1 from Nathan S.  ---
Pull request: https://github.com/dlang/phobos/pull/6139

--


[Issue 18398] New: std.datetime.stopwatch documented examples could be better

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18398

  Issue ID: 18398
   Summary: std.datetime.stopwatch documented examples could be
better
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: minor
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: n8sh.second...@hotmail.com

Someone using `std.datetime.stopwatch` probably wants to use it to obtain a
time in milliseconds or some other unit of time but none of the example code on
the page involves converting a core.time.Duration. This makes the examples less
helpful to a newcomer than they could be.

Proposed addition:

```d
/// Measure a time in milliseconds, microseconds, or nanoseconds
@safe nothrow @nogc unittest
{
auto sw = StopWatch(AutoStart.no);
sw.start();
// ... Insert operations to be timed here ...
sw.stop();

long msecs = sw.peek().total!"msecs";
long usecs = sw.peek().total!"usecs";
long nsecs = sw.peek().total!"nsecs";

assert(usecs >= msecs * 1000);
assert(nsecs >= usecs * 1000);
}
```

--


[Issue 18388] std.experimental.logger slow performance

2018-02-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18388

--- Comment #2 from anonymous4  ---
AFAIK, default logger implementations are simplistic and are not meant to be
very fast. Fast logging requires a bit of design and is supposed to be 3rd
party library, while std.experimental.logger provides a way to integrate it.

--