[Issue 4826] cannot create associative array and compiler crash

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||diagnostic


--- Comment #3 from Don clugd...@yahoo.com.au 2010-09-06 23:56:32 PDT ---
Reduced test case:
--
struct Struct4826 {}

void bug4826(T)(T[string] value) {}

void test4826()
{
bug4826(Struct4826());
}


This is closely related to bug 3996. The patch for bug 3996 removes the
segfault, leaving only a useless error message with no line number, followed by
a sensible error message with line number.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4826] cannot create associative array and compiler crash

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826



--- Comment #4 from Don clugd...@yahoo.com.au 2010-09-07 00:04:26 PDT ---
Actually even with the patch for bug 3996, I found a test case which still
segfaults:

struct Struct4826 { }

void bug4826b(T)(int[int] value) {}

void test4826b()
{
bug4826b(Struct4826());
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4835] New: DMD should warn about integer overflow in computed constant

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4835

   Summary: DMD should warn about integer overflow in computed
constant
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: lars.holo...@gmail.com


--- Comment #0 from Lars Holowko lars.holo...@gmail.com 2010-09-07 10:09:23 
PDT ---
I got bitten by this when I wanted to create a 6GB large file to test 64 bit
support in std.stdio with dmd 2.048.


The output of:


import std.stdio;

void main(string args[])
{
long l_dangerous = 1024 * 1024 * 1024 * 6;
writefln(l_dangerous = 0x%x, l_dangerous);
writefln(l_dangerous = %s, l_dangerous);

long l_ok = 1024 * 1024 * 1024 * 6L;
writefln(l_ok = 0x%x, l_ok);
writefln(l_ok = %s, l_ok);
return;
}

is

l_dangerous = 0x8000
l_dangerous = -2147483648
l_ok = 0x18000
l_ok = 6442450944


dmd 2.048 did not issue a warning about the integer overflow (neither with or
without -w)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4835] DMD should warn about integer overflow in computed constant

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4835


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-09-07 12:39:13 PDT ---
I'm asking for overflow detection for years (both at compile-time and
run-time).

Again here the C language is better than the D language:

// C code
#include stdio.h
int main() {
long long x = 1024 * 1024 * 1024 * 6;
printf(%lld\n, x);
return 0;
}


GCC 4.3.4 gives:
prog.c: In function ‘main’:
prog.c:3: warning: integer overflow in expression

D compiler is not _practical_ enough yet.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4836] New: duplicated union initialization without a union

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4836

   Summary: duplicated union initialization without a union
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: i.kas...@gmx.de


--- Comment #0 from Ivo Kasiuk i.kas...@gmx.de 2010-09-07 12:49:28 PDT ---
The following compilation error does not seem to make sense:

$ cat test.d
class C {
  string s = null;
  mixin template M() { }
  mixin M!() m1;// line 4
  mixin template M(T) { }   // line 5
  mixin M!(int) m2;
}
$ dmd -c test
test.d(1): Error: class test.C duplicated union initialization for s
$

Interestingly, the file compiles without error if line 4 and 5 are swapped.

Tested with DMD v2.048

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4837] New: Assertion failure: '0' on line 608(614) in file 'constfold.c' during CTFE

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4837

   Summary: Assertion failure: '0' on line 608(614) in file
'constfold.c' during CTFE
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: stanislav.bli...@gmail.com


--- Comment #0 from Stanislav Blinov stanislav.bli...@gmail.com 2010-09-07 
13:05:21 PDT ---
Compilation fails with assertion in constfold.c:608 or constfold.c:614 for the
following code:

bool foo(T)(T t)
{
t = 1;   // triggers assertion for ubytes and ushorts
// t = t  1; // this compiles with no errors
return true;
}

void main()
{
auto g1 = foo!ubyte(1); // Ok for runtime
auto g2 = foo!ushort(1); // Ok for runtime

// CTFE:
enum e1 = foo!ubyte(1);  // Assertion failure: '0' on line 608 in file
'constfold.c'
enum e2 = foo!ushort(1); // Assertion failure: '0' on line 614 in file
'constfold.c'
}

DMD 2.048

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4826] cannot create associative array and compiler crash

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4826



--- Comment #5 from Don clugd...@yahoo.com.au 2010-09-07 13:47:50 PDT ---
The segfault should be turned into an ICE by adding an extra assert into
TypeAArray::getImpl(), in mtype.c 3967.

+assert(ti-inst || sc);
ti-semantic(sc);
ti-semantic2(sc);
ti-semantic3(sc);

The problem is, that the template instance needs a scope (sc), but the scope is
never set, so it remains NULL, causing a segfault when it is first used. I
don't know how to solve this. I'm not even sure of what the scope should be.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4838] New: Cannot declare a delegate variable for const member functions

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4838

   Summary: Cannot declare a delegate variable for const member
functions
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot c...@klickverbot.at 2010-09-07 15:38:30 PDT 
---
Given �class A { void foo() const {} }; A a = new A;�,
�typeof(a.foo).stringof� yields �void delegate() const�.

However, trying to declare a delegate variable of this type like �void
delegate() const dg; dg = a.foo;� fails with �const/immutable/shared/inout
attributes are only valid for non-static member functions� or, depending on the
scope one tries to declare the variable in, even more cryptic error messages.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4834] Implicit sharing via delegates in std.concurrency

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4834


David Simcha dsim...@yahoo.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #1 from David Simcha dsim...@yahoo.com 2010-09-07 16:07:02 PDT ---
http://dsource.org/projects/phobos/changeset/1964

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4814] rdmd: Doesn't rebuild when using -of and turning an -L linker option on or off

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4814


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

Summary|rdmd: Doesn't rebuild when  |rdmd: Doesn't rebuild when
   |using -of and turning   |using -of and turning an -L
   |-L--export-dynamic on or|linker option on or off
   |off |


--- Comment #1 from Nick Sabalausky cbkbbej...@mailinator.com 2010-09-07 
16:16:16 PDT ---
This seems to apply to any linker option.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4838] Cannot declare a delegate variable for const member functions

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4838


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-09-07 16:33:20 PDT ---
Maybe you want to rewrite those code snippets into readable indented little
runnable programs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3564] Rdmd failing to link external C libraries

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3564


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #2 from Nick Sabalausky cbkbbej...@mailinator.com 2010-09-07 
19:01:56 PDT ---
There's one more file I forgot to include in my example above:


$ cat theLib.di
module theLib;
void foo();


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3564] Rdmd failing to link external C libraries

2010-09-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3564


Nick Sabalausky cbkbbej...@mailinator.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |


--- Comment #3 from Nick Sabalausky cbkbbej...@mailinator.com 2010-09-07 
19:19:08 PDT ---
Reopening, didn't notice this was regarding linking to C.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---