[Issue 14321] Unnecessary destructor call with and AA's

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14321

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

   What|Removed |Added

   Keywords||pull, wrong-code
Summary|2.067.0-rc1 - No postblit   |Unnecessary destructor call
   |call with struct and AA's   |with and AA's

--- Comment #3 from Kenji Hara k.hara...@gmail.com ---
When an AA entry is newly created and initialized by the rvalue rhs, the value
will be moved in the allocated slot. So the expected behavior is:

 
 CTor
 end of main
 

https://github.com/D-Programming-Language/dmd/pull/4512

--


[Issue 14314] 2.067-rc1: ICE compiling project which has compiled fine for years

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14314

Martin Nowak c...@dawg.eu changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||c...@dawg.eu
 Resolution|--- |DUPLICATE

--- Comment #4 from Martin Nowak c...@dawg.eu ---


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

--


[Issue 14304] [REG2.067a] ICE with static immutable variable CTFE

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14304

Martin Nowak c...@dawg.eu changed:

   What|Removed |Added

 CC||turkey...@gmail.com

--- Comment #6 from Martin Nowak c...@dawg.eu ---
*** Issue 14314 has been marked as a duplicate of this issue. ***

--


[Issue 72] valgrind: use of unitialized values in the gcx module

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=72

Vladimir Panteleev thecybersha...@gmail.com changed:

   What|Removed |Added

 CC||thecybersha...@gmail.com

--- Comment #8 from Vladimir Panteleev thecybersha...@gmail.com ---
(In reply to Brad Roberts from comment #6)
 Two ways to fix it, that I can see:

There is a third way.

We can use the Valgrind client API to tell Valgrind to pretend that the entire
stack is accessible and has well-defined data, using VALGRIND_MAKE_MEM_DEFINED.

By itself, this will hide bugs in user code that accesses uninitialized stack
values. However, that can also be avoided by using VALGRIND_GET_VBITS and
VALGRIND_SET_VBITS to back up and restore the validity state of the stack
before and after a GC scan.

   1) always initialize empty stack slots -- cost performance

A small performance loss when running under Valgrind is rarely an issue. I
think the main difficulty with this approach is that it might not be possible
to implement, because we have no control over the stack frames of C functions.

--


[Issue 12406] Broken delegate closure

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12406

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

   What|Removed |Added

   Keywords||pull
   Severity|normal  |major

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

--


[Issue 14314] 2.067-rc1: ICE compiling project which has compiled fine for years

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14314

Vladimir Panteleev thecybersha...@gmail.com changed:

   What|Removed |Added

   Severity|critical|regression

--


[Issue 13856] std.stdio.readln stomps arrays

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13856

--- Comment #6 from Ali Cehreli acehr...@yahoo.com ---
Both of the bugs that are marked as duplicates of this one use byLine.
(However, bug 14005 seems to be cured at this time.)

Ali

--


[Issue 10925] unittests qualified on the right hand side fail

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10925

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

   What|Removed |Added

   Keywords||pull

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

--


[Issue 14314] 2.067-rc1: ICE compiling project which has compiled fine for years

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14314

Vladimir Panteleev thecybersha...@gmail.com changed:

   What|Removed |Added

 CC||thecybersha...@gmail.com

--- Comment #3 from Vladimir Panteleev thecybersha...@gmail.com ---
Was Dustmite unsuitable in reducing this problem?

--


[Issue 13856] std.stdio.readln stomps arrays

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13856

Martin Nowak c...@dawg.eu changed:

   What|Removed |Added

 CC||c...@dawg.eu

--- Comment #5 from Martin Nowak c...@dawg.eu ---
As an intermediate replacement it is possible to use byLine.

--


[Issue 14314] 2.067-rc1: ICE compiling project which has compiled fine for years

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14314

--- Comment #5 from Martin Nowak c...@dawg.eu ---
I'm pretty sure it's the same issue.
Next version is the final release.

--


[Issue 14327] Unhandled exception from writeln() in C++/D application

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14327

yebblies yebbl...@gmail.com changed:

   What|Removed |Added

   Keywords||C++
 CC||yebbl...@gmail.com

--


[Issue 14329] New: [2.067] offline doc - menu broken due to missing jquery-1.7.2.min.js

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14329

  Issue ID: 14329
   Summary: [2.067] offline doc - menu broken due to missing
jquery-1.7.2.min.js
   Product: D
   Version: D2
  Hardware: All
OS: Windows
Status: NEW
  Severity: normal
  Priority: P1
 Component: websites
  Assignee: nob...@puremagic.com
  Reporter: bb.t...@gmx.com

The documentation distributed with the 2067 release cant be browsed **offline**
because the expandable menus are broken due to a missing js in html/d/js,
(jquery-1.7.2.min.js). For example if you start from index.html.

How to reproduce: clean the browser cache, unplug your ethernet cable and open
index.html...

The script should stand in the offline equivalent of http://dlang.org/js/.

--


[Issue 14325] [CTFE] Comparison of AAs makes wrong result

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14325

--- 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/6e41bfa6268fc44f3a767b32bb8cfb845265a5d7
fix Issue 14325 - [CTFE] Comparison of AAs makes wrong result

https://github.com/D-Programming-Language/dmd/commit/99479d425e26cd00b7fc72057a60927e5106961d
Merge pull request #4515 from 9rnsr/fix14325

Issue 14325 - [CTFE] Comparison of AAs makes wrong result

--


[Issue 14329] [2.067] offline doc - menu broken due to missing jquery-1.7.2.min.js

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14329

Vladimir Panteleev thecybersha...@gmail.com changed:

   What|Removed |Added

 CC||c...@dawg.eu,
   ||thecybersha...@gmail.com

--


[Issue 13856] std.stdio.readln stomps arrays

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13856

Steven Schveighoffer schvei...@yahoo.com changed:

   What|Removed |Added

 CC||schvei...@yahoo.com

--- Comment #7 from Steven Schveighoffer schvei...@yahoo.com ---
(In reply to Martin Nowak from comment #5)
 As an intermediate replacement it is possible to use byLine.

Not really. readln does not do the same thing as byLine.

I don't know how you would use byline instead of readln in the OP code. byLine
is not really meant to be a read a line here or there type of operation, it's
meant to exhaust the stream a line at a time.

--


[Issue 5770] Template constructor bypass access check

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5770

Nicolas Sicard dran...@gmail.com changed:

   What|Removed |Added

 CC||dran...@gmail.com

--- Comment #3 from Nicolas Sicard dran...@gmail.com ---
Still in 2.067.0-rc1.

--


[Issue 11587] Cannot compare AAs at compile time

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11587

--- Comment #4 from Kenji Hara k.hara...@gmail.com ---
(In reply to Nicolas Sicard from comment #3)
 Is this error related to this (supposedly fixed) bug?
 
 static assert([1: 1] != [1: 2, 2: 1]); // OK
 static assert([1: 1] != [1: 2]); // OK
 static assert([1: 1] != [2: 1]); // Error!
 
 DMD 2.067-rc1

It's a bug in the pull 2869 implementation.

New issue for that: https://issues.dlang.org/show_bug.cgi?id=14325

--


[Issue 12417] `toStringz` is fundamentally broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12417

John Colvin john.loughran.col...@gmail.com changed:

   What|Removed |Added

 CC||john.loughran.colvin@gmail.
   ||com

--- Comment #3 from John Colvin john.loughran.col...@gmail.com ---
You mean something like this?

//D

extern(C) void foo(int* a);

void main()
{
foo(new int);
}

//C

#includestdlib.h

void gc_collect();

// I solemnly swear this function does not
// hold any references to `a`
void foo(int* a)
{
int** m = (int**)malloc(sizeof(int*));
*m = a;
a = 0;

//Doesn't have to be explicit, could be from
//another thread or triggered in a D callback
gc_collect();

int b = **m; //oops!

free(m);
}


The question is, are you always guaranteed to have a reference on the caller
side? If not, then I think we have a problem.

E.g. what DMD and clang spit out without optimisations (edited):

__Dmain:
00011610pushq%rbp
00011611movq%rsp, %rbp
00011614movq0x199e5(%rip), %rdi ## literal pool symbol
address: _D11TypeInfo_Pi6__initZ
0001161bcallq0x1000199d0 ## symbol stub for:
__d_newitemT
00011620movq%rax, %rdi
# only references to the memory are in %rax and %rdi
00011623callq_foo
00011628xorl%eax, %eax
0001162apopq%rbp
0001162bretq

_foo:
00011650pushq%rbp
00011651movq%rsp, %rbp
00011654subq$0x20, %rsp
00011658movabsq$0x8, %rax
# %rax has been overwritten, only references is in %rdi
00011662movq%rdi, -0x8(%rbp)
# %rdi and %rbp-8
00011666movq%rax, %rdi
# %rbp-8
00011669callq0x100019b56 ## symbol stub for:
_malloc
0001166emovq%rax, -0x10(%rbp)
00011672movq-0x8(%rbp), %rax
# %rax and %rbp-8
00011676movq-0x10(%rbp), %rdi
0001167amovq%rax, (%rdi)
# %rax, %rbp-8 and on C heap at (%rdi)
0001167dmovq$0x0, -0x8(%rbp)
# %rax and on C heap at (%rdi)
00011685movb$0x0, %al
# %rax lowest byte stomped, only reference on C heap at (%rdi)
00011687callq0x10001987a ## symbol stub for:
_gc_collect
# GC has no references it can see, frees the memory
0001168cmovq-0x10(%rbp), %rdi
00011690movq(%rdi), %rdi
# %rdi is now dangling pointer
00011693movl(%rdi), %ecx
# BOOM!
00011695movl%ecx, -0x14(%rbp)
00011698movq-0x10(%rbp), %rdi
0001169ccallq0x100019b3e ## symbol stub for: _free
000116a1addq$0x20, %rsp
000116a5popq%rbp
000116a6retq


Am I reading that right? I think it might be OK in this example because of the
remaining bytes of %rax but I don't see why we can rely on that.

--


[Issue 14325] New: [CTFE] Comparison of AAs makes wrong result

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14325

  Issue ID: 14325
   Summary: [CTFE] Comparison of AAs makes wrong result
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: CTFE, wrong-code
  Severity: normal
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: k.hara...@gmail.com

Issue cases:

static assert([1: 1] != [1: 2, 2: 1]); // OK
static assert([1: 1] != [1: 2]);   // OK
static assert([1: 1] != [2: 1]);   // Error!
static assert([1: 1, 2:2] != [3: 3, 4:4]); // Error!

--


[Issue 14324] Cannot cast AA to immutable at compile time

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14324

Nicolas Sicard dran...@gmail.com changed:

   What|Removed |Added

   Keywords||CTFE

--


[Issue 14324] New: Cannot cast AA to immutable at compile time

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14324

  Issue ID: 14324
   Summary: Cannot cast AA to immutable at compile time
   Product: D
   Version: D2
  Hardware: x86_64
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: dran...@gmail.com

immutable(int)[string] foo(int[string] aa) {
return cast(immutable(int)[string]) aa;
}

void main() {
auto x = foo([a: 1]);
enum y = foo([a: 1]); // Error
}

bug.d(2): Error: cannot cast [a:1] to immutable(int)[string] at compile time

Maybe related to bug #11627.

--


[Issue 14325] [CTFE] Comparison of AAs makes wrong result

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14325

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/4515

--


[Issue 14330] Global variable causes wrong DWARF type of local variable

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14330

Martin Krejcirik m...@krej.cz changed:

   What|Removed |Added

   Keywords||symdeb

--


[Issue 14330] New: Global variable causes wrong DWARF type of local variable

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14330

  Issue ID: 14330
   Summary: Global variable causes wrong DWARF type of local
variable
   Product: D
   Version: D2
  Hardware: x86
OS: Linux
Status: NEW
  Severity: minor
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: m...@krej.cz

__gshared ulong globvar; //ulong triggers bug

void main()
{
string str = something;
int i;
i++;
}

Breakpoint 1, D main () at dwarfbug.d:8
8   }
(gdb) info locals
str = 578532781965967369
i = 1
(gdb) ptype str
type = unsigned long long

dmd 2.066 and master, x86

--


[Issue 14329] [2.067] offline doc - menu broken due to missing jquery-1.7.2.min.js

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14329

--- Comment #1 from Martin Nowak c...@dawg.eu ---
Don't the menus work without js? And seriously how useful are the offline HTML
docs?

--


[Issue 14332] New: support with statement and :

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14332

  Issue ID: 14332
   Summary: support with statement and :
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: deadal...@gmail.com

D supports : as an indicator to create a scope up to the end of the enclosing
scope.

This does not work for this:

with(Foo): // Error: found ':' instead of statement

If there is no specific reason for this to not work, then it should be
supported.

--


[Issue 14331] New: Can't call `destroy()` on a class with `alias this` on a struct field

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14331

  Issue ID: 14331
   Summary: Can't call `destroy()` on a class with `alias this` on
a struct field
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: normal
  Priority: P1
 Component: DMD
  Assignee: nob...@puremagic.com
  Reporter: initrd...@gmail.com

This code:

class Test {
struct Foo {
int a, b, c;
}

Foo foo;
alias foo this;
}

void main() {
auto test = new Test();
destroy(test);
}

Fails to compile with the following message:

$ rdmd test.d
c:\D\dmd2\windows\bin\..\..\src\druntime\import\object.di(523): Error:
cannot cast from Foo to void*
test.d(13): Error: template instance object.destroy!(Test) error
instantiating
Failed: [dmd, -v, -o-, test.d, -I.]

Presumably because the `cast(void*)` is trying to cast the struct that is
aliased instead of the class. Removing the `alias foo this` causes the code to
compile.

Using version 2.066.1 at the moment, but I didn't see anything related in the
changelog for v2.067.

--


[Issue 9685] Context pointer of struct isn't copied when a closure is passed by alias

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9685

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

   What|Removed |Added

 CC||tta...@gmail.com

--- Comment #6 from Kenji Hara k.hara...@gmail.com ---
*** Issue 10963 has been marked as a duplicate of this issue. ***

--


[Issue 14329] [2.067] offline doc - menu broken due to missing jquery-1.7.2.min.js

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14329

--- Comment #2 from Vladimir Panteleev thecybersha...@gmail.com ---
The reason is that jquery-1.7.2.min.js is missing from the makefile rules, BTW

--


[Issue 12811] GC-allocated closure for calling instance function in filter

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12811

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

   What|Removed |Added

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

--- Comment #1 from Kenji Hara k.hara...@gmail.com ---
(In reply to bearophile_hugs from comment #0)
 import std.algorithm: filter;
 struct Foo {
 bool bar(in int) @nogc {
 return true;
 }
 auto spam() @nogc {
 immutable static data = [1, 2];
 return data.filter!(i = bar(i));

'filter' will lazily evaluate the given array outside of the 'spam' function,
so the lambda 'i = bar(i)' needs to capture 'this' variable to call member
function 'bar'.

It will make a closure allocation.

 This gives a similar error:
 
 import std.algorithm: filter;
 struct Foo {
 bool bar(in int) @nogc {
 return true;
 }
 auto spam() @nogc {
 immutable static data = [1, 2];
 scope immutable f = (int i) = bar(i);
 return data.filter!f;

To access the delegate variable f later, 'filter' should capture the function
frame of 'spam' (and it will indirectly capture the 'this' of 'spam' function).
It will need a closure allocation.

--


[Issue 10963] Wrong code with aliased function referencing closure variable

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10963

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Kenji Hara k.hara...@gmail.com ---
It's a duplication of 9685, and properly fixed in 2.067.

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

--


[Issue 14332] support with statement and :

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14332

Ketmar Dark ket...@ketmar.no-ip.org changed:

   What|Removed |Added

 CC||ket...@ketmar.no-ip.org

--- Comment #1 from Ketmar Dark ket...@ketmar.no-ip.org ---
where in specs ':' is specified as scope start?

--


[Issue 11573] [ld.gold] debug information doesn't work

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11573

Martin Krejcirik m...@krej.cz changed:

   What|Removed |Added

 CC||m...@krej.cz

--- Comment #1 from Martin Krejcirik m...@krej.cz ---
Fixed ?

--


[Issue 13337] Invalid extern C++ namespace resolution

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13337

Colden Cullen coldencul...@gmail.com changed:

   What|Removed |Added

 CC||coldencul...@gmail.com

--- Comment #4 from Colden Cullen coldencul...@gmail.com ---
*** Issue 14092 has been marked as a duplicate of this issue. ***

--


[Issue 14092] C++ mangling for struct nested inside same class as static function is broken when in namespace

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14092

Colden Cullen coldencul...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Colden Cullen coldencul...@gmail.com ---


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

--


[Issue 12406] Broken delegate closure

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12406

--- Comment #5 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/ceb20a25a55827d6b2644329839edf642557e552
fix Issue 12406 - Broken delegate closure

https://github.com/D-Programming-Language/dmd/commit/d49c7dc77afe64c7f39683461e38a680a9fa2c04
Merge pull request #4513 from 9rnsr/fix12406

Issue 12406 - Broken delegate closure

--


[Issue 12688] Strange error if function call is in parentheses

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12688

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

   What|Removed |Added

 CC||czda...@gmail.com

--- Comment #4 from Kenji Hara k.hara...@gmail.com ---
*** Issue 11950 has been marked as a duplicate of this issue. ***

--


[Issue 11950] Weird bracket behavior in delegates

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11950

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Kenji Hara k.hara...@gmail.com ---
Fixed in 2.066.

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

--


[Issue 9148] 'pure' is broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9148

--- Comment #14 from Kenji Hara k.hara...@gmail.com ---
*** Issue 10614 has been marked as a duplicate of this issue. ***

--


[Issue 10614] A delegate erroneously inferred as impure

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10614

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Kenji Hara k.hara...@gmail.com ---
(In reply to bearophile_hugs from comment #0)
 struct Foo {
 immutable int y;
 void bar(TF)(TF f) pure {
 f(1);
 }
 void spam() pure {
 bar((int x) = y);
 }
 }
 void main() {}

By fixing issue 9148, a lambda (int x) = y is deduced to weak purity.
Therefore its call will be accepted in bar.

Will be fixed 2.067 and later.

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

--


[Issue 12406] Broken delegate closure

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12406

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

   What|Removed |Added

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

--


[Issue 9148] 'pure' is broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9148

--- Comment #15 from Kenji Hara k.hara...@gmail.com ---
*** Issue 11412 has been marked as a duplicate of this issue. ***

--


[Issue 11412] Allow nested pure functions to access outer function variables

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11412

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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Kenji Hara k.hara...@gmail.com ---
Will be fixed from 2.067.

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

--


[Issue 14332] support with statement and :

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14332

Orvid King blah38...@gmail.com changed:

   What|Removed |Added

 CC||blah38...@gmail.com

--- Comment #2 from Orvid King blah38...@gmail.com ---
Going by that same definition, wouldn't:

if (true):
else:

foreach (v; arr):


etc. also be allowed? I don't believe this should be the case.

--


[Issue 12417] `toStringz` is fundamentally broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12417

--- Comment #6 from Denis Shelomovskij verylonglogin@gmail.com ---
(In reply to John Colvin from comment #5)
 Well in that case we have a problem with all calls to C that follow this
 pattern:
 
 allocate some GC memory
 pass a pointer to said memory to C
 never refer to the memory again

As D's GC may eventually become a moving GC one mustn't do it anyway.

--


[Issue 12417] `toStringz` is fundamentally broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12417

--- Comment #5 from John Colvin john.loughran.col...@gmail.com ---
Well in that case we have a problem with all calls to C that follow this
pattern:

allocate some GC memory
pass a pointer to said memory to C
never refer to the memory again

as there is nothing to guarantee that there will be any reference held on the D
side during the execution of the C function and no guarantee about where the C
function will hold the reference during its execution. There will be cases
where the optimiser will play nice, but in general it has no obligation to
preserve a reference on the D side to memory that is never accessed again.

--


[Issue 14326] New: syntax highlighting of dpl-docs no longer works

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14326

  Issue ID: 14326
   Summary: syntax highlighting of dpl-docs no longer works
   Product: D
   Version: unspecified
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: websites
  Assignee: slud...@outerproduct.org
  Reporter: c...@dawg.eu

Probably related to the exception I get for this line.

$('#symbolSearchPane').show();

Uncaught ReferenceError: $ is not defined

--


[Issue 14327] New: Unhandled exception from writeln() in C++/D application

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14327

  Issue ID: 14327
   Summary: Unhandled exception from writeln() in C++/D
application
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: major
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: szymon.gat...@gmail.com

With this C++ application:

extern C int rt_init(); // prototypes of standard D runtime functions
extern C void rt_term();

extern C void dfunc();

int main()
{
  auto dinit = rt_init(); // returns 1
  dfunc(); // causes unhandled exception
}

and linking to this D library:

module lib;

extern(C) void dfunc()
{
  import std.stdio;
  writeln(Hello from D!);
}

int main()
{
  return 0;
}

call to dfunc() on C++ side causes Unhandled exception in stdio.d line 2917:

// Specialization for strings - a very frequent case
auto w = .trustedStdout.lockingTextWriter();

initial report on D forums [1] leads potential issue with stdio module static
initialization failure.

Using Visual Studio 2012, x64 app, Win 7 x64

[1]
http://forum.dlang.org/thread/hsglkscatlniiuacp...@forum.dlang.org#post-mailman.397.1409844359.5783.digitalmars-d-learn:40puremagic.com

--


[Issue 11587] Cannot compare AAs at compile time

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11587

Nicolas Sicard dran...@gmail.com changed:

   What|Removed |Added

 CC||dran...@gmail.com

--- Comment #3 from Nicolas Sicard dran...@gmail.com ---
Is this error related to this (supposedly fixed) bug?

static assert([1: 1] != [1: 2, 2: 1]); // OK
static assert([1: 1] != [1: 2]); // OK
static assert([1: 1] != [2: 1]); // Error!

DMD 2.067-rc1

--


[Issue 12417] `toStringz` is fundamentally broken

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12417

--- Comment #4 from Denis Shelomovskij verylonglogin@gmail.com ---
(In reply to John Colvin from comment #3)
 You mean something like this?

Yes, this is an example of what may go wrong. But in a general case we don't
even know what calling convention (e.i. ABI) so the reference can be easily
lost.

Also now most `toStringz`/`toUTF16z`/`toUTFz` usages in Phobos are replaced
with `tempCString*` ones [1] so this doesn't affect much Phobos itself.

The problem is `toStringz` and friends aren't properly documented as dangerous
(and also inefficient by the way) and `tempCString*` replacement isn't public
(addition of new public features to Phobos looks too complicated for me).

[1] https://github.com/D-Programming-Language/phobos/pull/2332

--


[Issue 14326] syntax highlighting of dpl-docs no longer works

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14326

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

https://github.com/D-Programming-Language/dlang.org/commit/1ec3961e7fa4fd7840408be54c6213fc1dc13ede
Fix issue 14326 - Fixes JS error and missing syntax highlighting.

Was caused by missing imports of jQuery and the Prettify CSS.

https://github.com/D-Programming-Language/dlang.org/commit/0c1bce0ddd80ed3b244580b42489f268cb9d4fac
Merge pull request #937 from s-ludwig/master

Fix issue 14326 - Fixes JS error and missing syntax highlighting.

--


[Issue 14328] New: The terms lvalue and rvalue should be added to the glossary

2015-03-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14328

  Issue ID: 14328
   Summary: The terms lvalue and rvalue should be added to the
glossary
   Product: D
   Version: D2
  Hardware: All
   URL: http://dlang.org/glossary.html
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: websites
  Assignee: briancsch...@gmail.com
  Reporter: briancsch...@gmail.com

There are some places in the Phobos documentation that refer to the terms
lvalue and rvalue. These terms should be present in the glossary so that
the terms can link to their definition.

--