[Issue 19176] Dmd crashes because of __traits(getUnitTests)

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

Mike Franklin  changed:

   What|Removed |Added

   Keywords||pull
 CC||slavo5...@yahoo.com

--- Comment #1 from Mike Franklin  ---
Attempted fix: https://github.com/dlang/dmd/pull/8574

--


[Issue 19176] Dmd crashes because of __traits(getUnitTests)

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

ag0aep6g  changed:

   What|Removed |Added

   Keywords||ice
 CC||ag0ae...@gmail.com

--


[Issue 19177] New: No version (Solaris) in druntime/src/core/stdc/time.d

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

  Issue ID: 19177
   Summary: No version (Solaris) in druntime/src/core/stdc/time.d
   Product: D
   Version: D2
  Hardware: x86_64
OS: Solaris
Status: NEW
  Severity: critical
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: crayol...@gmail.com

When building ldc I get the following error;

/root/work/ldc/runtime/druntime/src/core/stdc/time.d(142): Error: static
assert:  "unsupported system"

This is because there is no version (Solaris) declared.

Need to add:

else version ( Solaris )
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}









Here is the full section;

///
version( Windows )
{
enum clock_t CLOCKS_PER_SEC = 1000;
clock_t clock();
}
else version( OSX )
{
enum clock_t CLOCKS_PER_SEC = 100;
version (X86)
extern (C) pragma(mangle, "clock$UNIX2003") clock_t clock();
else
clock_t clock();
}
else version( Darwin ) // other Darwins (iOS, TVOS, WatchOS)
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}
else version( FreeBSD )
{
enum clock_t CLOCKS_PER_SEC = 128;
clock_t clock();
}
else version( NetBSD )
{
enum clock_t CLOCKS_PER_SEC = 100;
clock_t clock();
}
else version( OpenBSD )
{
enum clock_t CLOCKS_PER_SEC = 100;
clock_t clock();
}
else version( DragonFlyBSD )
{
enum clock_t CLOCKS_PER_SEC = 128;
clock_t clock();
}
else version (CRuntime_Glibc)
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}
else version (CRuntime_Musl)
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}
else version (CRuntime_Bionic)
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}
else version (CRuntime_UClibc)
{
enum clock_t CLOCKS_PER_SEC = 1_000_000;
clock_t clock();
}
else
{
static assert(0, "unsupported system");
}

--


[Issue 18838] Formatting the number zero with separator doesn't obey width specifier

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

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

   What|Removed |Added

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

--


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

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

Mike Franklin  changed:

   What|Removed |Added

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

--- Comment #12 from Mike Franklin  ---
It appears this bug is back: 
https://github.com/dlang/druntime/pull/2230#issuecomment-413779078

--


[Issue 19175] @safe code can escape local array references

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

--- Comment #2 from Peter Alexander  ---
It is still broken with -dip1000

https://run.dlang.io/is/gJi2Fa

--


[Issue 19175] @safe code can escape local array references

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

Mike Franklin  changed:

   What|Removed |Added

   Keywords||safe
 CC||slavo5...@yahoo.com

--


[Issue 19160] wrong C++ mangle for const template args

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

Илья Ярошенко  changed:

   What|Removed |Added

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

--


[Issue 19160] wrong C++ mangle for const template args

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

--- Comment #5 from Илья Ярошенко  ---
(In reply to Nicholas Wilson from comment #3)
> https://github.com/dlang/dmd/pull/8432 is not part of 2.081.1 or 2.081.2. It
> is however part of 2.082.beta-1.
> 
> Try with DMD 2.082.beta-1 or newer, confirm if it works. If so we can cherry
> pick this onto LDC. If not I've got more fixing to do!

Thanks, it is fixed!

--


[Issue 19160] wrong C++ mangle for const template args

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

--- Comment #4 from Илья Ярошенко  ---
(In reply to Nicholas Wilson from comment #3)
> https://github.com/dlang/dmd/pull/8432 is not part of 2.081.1 or 2.081.2. It
> is however part of 2.082.beta-1.
> 
> Try with DMD 2.082.beta-1 or newer, confirm if it works. If so we can cherry
> pick this onto LDC. If not I've got more fixing to do!

Thanks, it is fixed!

--


[Issue 19176] New: Dmd crashes because of __traits(getUnitTests)

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

  Issue ID: 19176
   Summary: Dmd crashes because of __traits(getUnitTests)
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: fediushin.an...@yandex.ru

Test case:

```
void main() {
__traits(getUnitTests, foo);
}

template foo() {
static if(true) {
enum bar;
} else {
enum bar;
}
}
```

Results in:
```
$ dmd -v -c -unittest foo.d
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC unittest assert
D_HardFloat
binarydmd
version   v2.081.2
config/etc/dmd.conf
DFLAGS-I/usr/include/dlang/dmd -L-L/usr/lib -L--export-dynamic -fPIC
parse foo
importall foo
importobject(/usr/include/dlang/dmd/object.d)
semantic  foo
entry main  foo.d
semantic2 foo
semantic3 foo
foo.d(6): Error: static if conditional cannot be at global scope
zsh: segmentation fault (core dumped)  dmd -v -c -unittest foo.d
```

--


[Issue 19175] @safe code can escape local array references

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

Jonathan M Davis  changed:

   What|Removed |Added

 CC||issues.dl...@jmdavisprog.co
   ||m

--- Comment #1 from Jonathan M Davis  ---
This is a duplicate of https://issues.dlang.org/show_bug.cgi?id=8838, which was
closed as fixed based on the fact that -dip1000 fixes the problem. It's still
quite broken without -dip1000 though.

--


[Issue 19175] @safe code can escape local array references

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

Peter Alexander  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--


[Issue 19175] New: @safe code can escape local array references

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

  Issue ID: 19175
   Summary: @safe code can escape local array references
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: peter.alexander...@gmail.com


import std.algorithm, std.stdio;

@safe:

auto foo() {
  int[6] xs = [0, 1, 2, 3, 4, 5];
  return xs[].map!(x => x);
}

void main() {
  writeln(foo());
}


Observed: this compiles and (for me) prints [0, 0, -2132056872, 22008, 0, 0].

Expected: fail to compile with error about the escaped local reference.

--


[Issue 19174] New: Can't do conditional compiling with version attribute in enums

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

  Issue ID: 19174
   Summary: Can't do conditional compiling with version attribute
in enums
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: blocker
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: zmxqa...@abyssmail.com

Example code:

version = 2;

//This doesn't compile
enum Test1 {
A = 1,
B,
version(2){
C = 4,
}
else version(1){
C
}
const D = C+1;
}

//This compiles, hack of above
struct TEST2 {
const A = 1;
const B = A+1;
version(2){
const C = B+2;
}
else version(1){
const C = B+1;
}
const D = C+1;
} __gshared TEST2 Test2;

void main()
{
import std.stdio;

writeln(Test1.D); //Doesn't work
writeln(Test2.D); //Example of desired behavior working
}

-

Error log:
onlineapp.d(7): Error: basic type expected, not `version`
onlineapp.d(7): Error: no identifier for declarator `_error_`
onlineapp.d(7): Error: type only allowed if anonymous enum and no enum type
onlineapp.d(7): Error: if type, there must be an initializer
onlineapp.d(7): Error: found `version` when expecting `,`
onlineapp.d(7): Error: basic type expected, not `(`
onlineapp.d(7): Error: unexpected `(` in declarator
onlineapp.d(7): Error: basic type expected, not `2`
onlineapp.d(7): Error: found `2` when expecting `)`
onlineapp.d(7): Error: no identifier for declarator `_error_(_error_)`
onlineapp.d(7): Error: type only allowed if anonymous enum and no enum type
onlineapp.d(7): Error: if type, there must be an initializer
onlineapp.d(7): Error: found `)` when expecting `,`
onlineapp.d(7): Error: basic type expected, not `{`
onlineapp.d(7): Error: no identifier for declarator `_error_`
onlineapp.d(7): Error: type only allowed if anonymous enum and no enum type
onlineapp.d(7): Error: if type, there must be an initializer
onlineapp.d(7): Error: found `{` when expecting `,`
onlineapp.d(10): Error: declaration expected, not `else`
onlineapp.d(14): Error: unrecognized declaration



This is the same issue as Issue 9761 which was filed in 2013 and still listed
as new with a changed severity from enhancement to blocker as this is a case of
a feature that should work, as it does in similar other cases such as the
struct example provided, being broken.

--