[Issue 11077] iota() should be statically specialized for increment 1

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11077

Nicholas Wilson  changed:

   What|Removed |Added

 CC||iamthewilsona...@hotmail.co
   ||m
  Component|dmd |phobos

--- Comment #1 from Nicholas Wilson  ---
This is a phobos bug.

--


[Issue 10413] .init incorrectly accepts any expression

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10413

Nicholas Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||iamthewilsona...@hotmail.co
   ||m
 Resolution|--- |INVALID

--- Comment #5 from Nicholas Wilson  ---
int foo() { return 1; }

static assert(foo.init == 0);

is a case of optional parentheses, as

char foo() { return 1; }

static assert(foo.init == 255);

passes, but 

int foo(int) { return 1; }

static assert(foo.init == 0);

fails with 

onlineapp.d(3): Error: function onlineapp.foo(int) is not callable using
argument types ()
onlineapp.d(3):missing argument for parameter #1: int
onlineapp.d(3):while evaluating: static assert((__error).init == 0)

closing as invalid

--


[Issue 10369] Deprecate unordered floating point comparisons (!<>=, etc) and later remove them

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10369

Nicholas Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||iamthewilsona...@hotmail.co
   ||m
 Resolution|--- |WORKSFORME

--- Comment #13 from Nicholas Wilson  ---
The posted example now errors:

onlineapp.d(5): Error: template argument expected following !
onlineapp.d(5): Error: expression expected, not >=
onlineapp.d(5): Error: found b when expecting ; following statement
onlineapp.d(5): Deprecation: use { } for an empty statement, not ;
onlineapp.d(6): Error: expression expected, not >
onlineapp.d(6): Error: found b when expecting ; following statement
onlineapp.d(6): Deprecation: use { } for an empty statement, not ;
onlineapp.d(7): Error: expression expected, not >=
onlineapp.d(7): Error: found b when expecting ; following statement
onlineapp.d(7): Deprecation: use { } for an empty statement, not ;
onlineapp.d(8): Error: template argument expected following !
onlineapp.d(9): Error: template argument expected following !
onlineapp.d(10): Error: template argument expected following !
onlineapp.d(11): Error: template argument expected following !
onlineapp.d(12): Error: template argument expected following !
onlineapp.d(12): Error: expression expected, not >
onlineapp.d(12): Error: found b when expecting ; following statement
onlineapp.d(12): Deprecation: use { } for an empty statement, not ;

--


[Issue 10097] __ctor, __dtor, and __postblit should no appear in user code

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10097

Nicholas Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||iamthewilsona...@hotmail.co
   ||m
 Resolution|--- |INVALID

--- Comment #4 from Nicholas Wilson  ---
__dtor is needed for dealing with stack allocated classes to call the
destructor so I'm going to close this as invalid.

--


[Issue 9969] dmd ABI mistake (cfloat static array initialisation)

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9969

Nicholas Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||iamthewilsona...@hotmail.co
   ||m
 Resolution|--- |WORKSFORME

--- Comment #7 from Nicholas Wilson  ---
extern(C) int printf(const char*, ... );

extern(C) long *_memset64(long *p, long value, size_t count);

void main()
{
cfloat[2] arr = void;
_memset64(cast(long*)arr.ptr, 1, 2);
printf("%d %d\n", *(cast(long*)[0]), *(cast(long*)[1]));
}

works on current as does

extern(C) int printf(const char*, ... );

extern(C) long *_memset64(cfloat *p, long value, size_t count);

void main()
{
cfloat[2] arr = void;
_memset64(arr.ptr, 1, 2);
printf("%d %d\n", *(cast(long*)[0]), *(cast(long*)[1]));
}

as does 

void main()
{
cfloat[2] a;
}

--


[Issue 3924] nothrow ignored in some situations

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3924

Nicholas Wilson  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||iamthewilsona...@hotmail.co
   ||m
 Resolution|--- |WORKSFORME

--- Comment #3 from Nicholas Wilson  ---
Examples given no longer compile:

void main() {
nothrow void delegate() c = { throw new Exception(""); };
c();
}

gives

onlineapp.d(2): Error: cannot implicitly convert expression __lambda1 of type
void delegate() pure @safe to void delegate() nothrow
onlineapp.d(2): Error: cannot implicitly convert expression __lambda1 of type
void delegate() pure @safe to void delegate() nothrow

nothrow auto foo() {
throw new Exception("");
}
void main() {
foo();
}

gives

onlineapp.d(2): Error: object.Exception is thrown but not caught
onlineapp.d(1): Error: nothrow function onlineapp.foo may throw

nothrow auto foo() {
auto c = { throw new Exception(""); };
c();
}
void main() {
foo();
}

onlineapp.d(3): Error: c is not nothrow
onlineapp.d(1): Error: nothrow function onlineapp.foo may throw

--


[Issue 20348] [Reg 2.089.0-rc.1] Bad debug info for enum forward references

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20348

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@rainers created dlang/dmd pull request #10530 "fix issue 20348 - Bad debug
info for enum forward reference" fixing this issue:

- fix issue 20348 - Bad debug info for enum forward reference

  do not rewrite the length of the debug record, it is padded during allocation

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

--


[Issue 20348] New: [Reg 2.089.0-rc.1] Bad debug info for enum forward references

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20348

  Issue ID: 20348
   Summary: [Reg 2.089.0-rc.1] Bad debug info for enum forward
references
   Product: D
   Version: D2
  Hardware: All
OS: Windows
Status: NEW
  Keywords: symdeb
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: r.sagita...@gmx.de

module endbg;

enum EnumTest
{
E1, E2, E3
}

void main()
{
EnumTest e1 = EnumTest.E1;
EnumTest e2 = EnumTest.E2;
}

Compiling this with "dmd -m64 -g endbg.d" and dumping it with cvdump yields:

...
0x1006 : Length = 29, Leaf = 0x1507 LF_ENUM
# members = 0,  type = T_INT4(0074) field list type 0x
FORWARD REF,enum name = endbg.EnumTest

0x1007 : Length = 29, Leaf = 0x1507 LF_ENUM
# members = 0,  type = T_INT4(0074) field list type 0x
FORWARD REF,enum name = endbg.EnumTest
...

i.e. the forward reference is emitted multiple times and has an odd length
(which can cause the debugger to crash).

--


[Issue 19646] Initialization of globals not checked for @safe

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19646

ag0aep6g  changed:

   What|Removed |Added

 CC||ag0ae...@gmail.com

--- Comment #3 from ag0aep6g  ---
The exact code from the description doesn't compile anymore. But we just need
to change some detail and DMD accepts it again. See issue 20347.

--


[Issue 20347] New: Initialization of globals not checked for @safe, round 2

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20347

  Issue ID: 20347
   Summary: Initialization of globals not checked for @safe, round
2
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: safe
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ag0ae...@gmail.com

This was found by dkorpel while working on a DIP:
https://github.com/dlang/DIPs/blob/7b109744db7fd0cfea9904354613a50e7dbdad08/DIPs/DIP1NNN-DK.md#existing-holes-in-safe

The fix for issue 19646 outlaws this code:


@safe:
const x = 42;
int* y = cast(int*)  /* Error: cast from const(int)* to int* not allowed in
safe code */
void main() { *y = 7; }


But the following two slight variations still pass.

1) Applying `@safe` individually:

@safe const x = 42;
@safe int* y = cast(int*)  /* Should be rejected. */
@safe void main() { *y = 7; }


2) Calling an @system function in the initializer:

@system int* f() { return cast(int*)  }
@safe:
const x = 42;
int* y = f(); /* Should be rejected. */
void main() { *y = 7; }


--


[Issue 14474] Use UTF-8 encoding for @cmdfile

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14474

godmyoh  changed:

   What|Removed |Added

 CC||menodinu...@gmail.com

--- Comment #3 from godmyoh  ---
Is anyone working on this issue?

This PR is closed but doesn't seem to be resolved.
https://github.com/dlang/dmd/pull/4602

--


[Issue 20331] checkaction=context segfaults when calling function literal

2019-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20331

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #10513 "Issue 20331 - checkaction=context segfaults when
calling function lit…" was merged into master:

- 4e85969f9d3c129b6595d9ecbd6e1a8d06a019fb by MoonlightSentinel:
  Issue 20331 - checkaction=context segfaults when calling function literal

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

--