[Issue 14230] New: [REG2.067b2] std.array.join misses the first element which is empty string

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14230

  Issue ID: 14230
   Summary: [REG2.067b2] std.array.join misses the first element
which is empty string
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: regression
  Priority: P1
 Component: Phobos
  Assignee: nob...@puremagic.com
  Reporter: j...@red.email.ne.jp

I sometimes use join() in this way.

join( [] ~ [aa,bb,cc],  @ )
 --  @aa @bb @cc

This doesn't work properly in D2.
This is a regression, probably.

--
import std.stdio;
import std.array;

void main()
{
string[] ary = [,aa,bb,cc]; // leaded by _empty_ element
writeln(ary.join( @));
// In 2.067b2, this outputs aa @bb @cc or asserts inside of join()

assert(ary.join( @) ==  @aa @bb @cc); // OK in 2.067b1 and olders
}
--

--


[Issue 14229] RAII ordering is wrong

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14229

Etienne etci...@gmail.com changed:

   What|Removed |Added

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

--- Comment #1 from Etienne etci...@gmail.com ---
I realized this is not an issue, because the destructors are called before the
destruction. So, this doesn't map the actual free'ing of the structs.

--


[Issue 13729] [REG2.067a] One not detected case of not purity

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13729

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

   What|Removed |Added

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

--


[Issue 13729] [REG2.067a] One not detected case of not purity

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13729

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3a9a56bce0d595fbe538946321e2fb8692711386
fix Issue 13729 - One not detected case of not purity

https://github.com/D-Programming-Language/dmd/commit/8b3bd7381a82dac630f5a8374618caf5a3b8ae98
Merge pull request #4447 from 9rnsr/fix13729

[REG2.067a] Issue 13729 - One not detected case of not purity

--


[Issue 6586] feqrel for const values too

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6586

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

   What|Removed |Added

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

--


[Issue 6586] feqrel for const values too

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6586

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/09ebc581ec022d0e1091d47887aab26366df79e0
rework and try to fix Issue 6586

https://github.com/D-Programming-Language/phobos/commit/62acd72cec052169e7eb56d1c63c860ae92f9ef9
Merge pull request #3017 from 9il/frexp

[2.067.0-b2][regression] fix Issues 14212 and 6586

--


[Issue 14212] frexp for const and immutable fails to compile

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14212

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

   What|Removed |Added

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

--


[Issue 14212] frexp for const and immutable fails to compile

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14212

--- Comment #6 from github-bugzi...@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/62acd72cec052169e7eb56d1c63c860ae92f9ef9
Merge pull request #3017 from 9il/frexp

[2.067.0-b2][regression] fix Issues 14212 and 6586

--


[Issue 14220] Bad codegen for optimized std.conv.text in combination with concatenation

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14220

--- Comment #3 from Kenji Hara k.hara...@gmail.com ---
Reduced test case:

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

void main()
{
auto a = toString(14);

printf(a.ptr = %p, a.length = %d\n, a.ptr, cast(int)a.length);
return;
}

auto toString(int value)
{
uint mValue = value;

char[int.sizeof * 3] buffer = void;
size_t index = buffer.length;

do
{
uint div = cast(int)(mValue / 10);
char mod = mValue % 10 + '0';
buffer[--index] = mod;// Line 22
mValue = div;
} while (mValue);

//printf(buffer.ptr = %p, index = %d\n, buffer.ptr, cast(int)index);
return dup(buffer[index .. $]);
}

char[] dup(char[] a)
{
//printf(a.ptr = %p, a.length = %d\n, a.ptr, cast(int)a.length);
a[0] = 1;   // segfault
return a;
}

The wrong-code bug is introduced by the change:
https://github.com/D-Programming-Language/dmd/pull/4415

However, the PR 4415 only affects to line 22. so I think the root issue would
exist in dmd backend optimizer.

--


[Issue 13729] [REG2.067a] One not detected case of not purity

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13729

Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Kenji Hara k.hara...@gmail.com ---
https://github.com/D-Programming-Language/dmd/pull/4447

--


[Issue 14225] [REG2.067a] GDB: error reading variable (string + dup)

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14225

--- Comment #2 from Martin Krejcirik m...@krej.cz ---
Small correction: -gc doesn't make it work.
Also the problem is not limited to recent gdb version, 7.4.1-debian is affected
too for example.

--


[Issue 14199] [REG2.067a] Dwarf Error: mangled line number section

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14199

--- Comment #4 from github-bugzi...@puremagic.com ---
Commit pushed to 2.067 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2a0108edaf3895ac2f23dc28b1d20c9c5edfe85e
Merge pull request # from MartinNowak/fix14199

fix Issue 14199 - [REG2.067a] Dwarf Error: mangled line number section

--


[Issue 14212] frexp for const and immutable fails to compile

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14212

--- Comment #7 from github-bugzi...@puremagic.com ---
Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/cf57c7529a63ac970167c65cb659d5249a3a1ab9
Merge pull request #3017 from 9il/frexp

[2.067.0-b2][regression] fix Issues 14212 and 6586

--


[Issue 6586] feqrel for const values too

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6586

--- Comment #5 from github-bugzi...@puremagic.com ---
Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/cf57c7529a63ac970167c65cb659d5249a3a1ab9
Merge pull request #3017 from 9il/frexp

[2.067.0-b2][regression] fix Issues 14212 and 6586

--


[Issue 14229] New: RAII ordering is wrong

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14229

  Issue ID: 14229
   Summary: RAII ordering is wrong
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: etci...@gmail.com

I'm having issues with the ordering of copy constructors / destructors, and
this causes my reference counting utilities to break down.

Here's the relevant code:

```
import std.stdio;

struct A {
this(B!A- i) {
b = i;
writeln(A.__ctor);
}
~this() { writeln(A.__dtor); }
this(this) { writeln(A.__copy); }
B!A- b;
}

struct B(string ident) {
this(C!B1- i, C!B2- j, C!B3- k) {
c = i;
c2 = j;
c3 = k;
writeln(ident ~ B.__ctor);
}
~this() { writeln(ident ~ B.__dtor); }
this(this) { writeln(ident ~ B.__copy); }
C!B1- c;
C!B2- c2;
C!B3- c3;
}

struct C(string ident) {
this(int i, int j, int k) {
   a = i;
   b = j;
   c = k;
   writeln(ident ~ C.__ctor);
}

~this() { writeln(ident ~ C.__dtor); }
this(this) { writeln(ident ~ C.__copy); }
int a;
int b;
int c;
}

C!B1- getC(A a) {
C!B1- c = a.b.c;
writeln(Returning B1-C);
return c;
}



void main() {
A a;
C!B1- c1 = C!B1-(1,2,3);
C!B2- c2 = C!B2-(4,5,6);
C!B3- c3 = C!B3-(7,8,9);
B!A- b = B!A-(c1, c2, c3);
a.b = b;

writeln(Getting C);

C!B1- c;
c = getC(a);
writeln(Got C);
}
```

The relevant output is:



Getting C
B1-C.__copy
B2-C.__copy
B3-C.__copy
A-B.__copy
A.__copy
B1-C.__copy
Returning B1-C
A.__dtor
A-B.__dtor
B3-C.__dtor
B2-C.__dtor
B1-C.__dtor
B1-C.__dtor
Got C



There's a mistake here.

The copy pattern under Getting C is fine. From the top down. To be equally
fine, destruction pattern should reverse it! It should propagate the
destruction tree from the bottom up. ie. you should be seeing:

B3-C.__dtor
B2-C.__dtor
B1-C.__dtor
A-B.__dtor
A.__dtor

Unfortunately, this might end up in the early destruction of an object
(segfault), and an absolute nightmare for the poor programmer debugging this
while expecting a bottom up destruction pattern.

--


[Issue 12983] overload not recognized depending on order of declaration

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12983

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

   What|Removed |Added

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

--


[Issue 12983] overload not recognized depending on order of declaration

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12983

--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ac443bd294103807f047ed9d74a05755f4e08f35
fix Issue 12983 - overload not recognized depending on order of declaration

https://github.com/D-Programming-Language/dmd/commit/dc11b92c6a3dce3f041e665c721cc83f5c0f5086
Merge pull request #4430 from 9rnsr/fix12983

Issue 12983 - overload not recognized depending on order of declaration

--


[Issue 14229] RAII ordering is wrong

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14229

Etienne etci...@gmail.com changed:

   What|Removed |Added

   Severity|enhancement |major

--


[Issue 14149] Bad std.algorithm error messages

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14149

sinkuup...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---
   Severity|regression  |normal

--


[Issue 12502] Some static array casts incorrectly rejected in safe code

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12502

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

   What|Removed |Added

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

--


[Issue 12502] Some static array casts incorrectly rejected in safe code

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12502

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c9f262ad6be7752da581d70dab9341aa585f3e77
fix Issue 12502 - Some static array casts incorrectly rejected in safe code

https://github.com/D-Programming-Language/dmd/commit/2670e331d780a8a8f114f5140db9c68c3be00daa
Merge pull request #4433 from 9rnsr/fix12502

Issue 12502 - Some static array casts incorrectly rejected in safe code

--


[Issue 13236] Invalid recursive struct field error not gagged in 'is'-expression

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13236

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

   What|Removed |Added

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

--


[Issue 14016] Nested inherited class doesn't know the type of its outer object

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14016

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/265fdb1e66678ef2b0918ba78fcfb7ab521d093b
fix Issue 14016 - Nested inherited class doesn't know the type of its outer
object

https://github.com/D-Programming-Language/dmd/commit/c18178d86510d11e25567fe14e470f77091b4ea7
Merge pull request #4429 from 9rnsr/fix14016

Issue 14016 - Nested inherited class doesn't know the type of its outer object

--


[Issue 13236] Invalid recursive struct field error not gagged in 'is'-expression

2015-02-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13236

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/6bcabda72140387afd10b2e369e4a4f9750a20f1
fix Issue 13236 - Invalid recursive struct field error not gagged in
'is'-expression

https://github.com/D-Programming-Language/dmd/commit/aee306108957e32b364804a58b64f6ea8d671954
Merge pull request #4432 from 9rnsr/fix13236

Issue 13236 - Invalid recursive struct field error not gagged in
'is'-expression

--