[Issue 2544] implicit const casting rules allow violations of const-safety

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2544



--- Comment #8 from Steven Schveighoffer  2010-03-16 
20:19:39 PDT ---
It appears that the offending code still compiles in dmd 2.041.  I can't
remember why I thought the given changeset should fix the problem, maybe it was
fixed and then regressed.  In any case, it's still broken.

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


[Issue 1426] const(templated class) allows calling mutable methods

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1426


Steven Schveighoffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||schvei...@yahoo.com
 Resolution||FIXED


--- Comment #1 from Steven Schveighoffer  2010-03-16 
20:08:30 PDT ---
Unsure of the version this was fixed, but it works as of 2.041.

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


[Issue 1339] Invariant/const-ness is broken by built-in array properties sort and reverse

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1339


Steven Schveighoffer  changed:

   What|Removed |Added

 CC||schvei...@yahoo.com
Summary|Invariant/const-ness is |Invariant/const-ness is
   |broken by built-in array|broken by built-in array
   |properties  |properties sort and reverse


--- Comment #9 from Steven Schveighoffer  2010-03-16 
20:06:45 PDT ---
The length property problems of this bug are fixed via the patch in bug 3637. 
This was incorporated in dmd 2.041.

The original test case for the length was invalid.

the code still prints 4 3 2 0, because it is OK to append to an
invariant(int)[].

A valid test that would have failed prior to 2.041:

import std.stdio;
void main()
{
invariant(int)[] x = [1,2,3,4];
auto y = x;
x.length = x.length - 1;
x.length = x.length + 1;
writeln(y); // prints 1 2 3 4 (prior to 2.041 would print 1 2 3 0)
writeln(x); // prints 1 2 3 0
}

The sort and reverse property bugs remain valid bugs.

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


[Issue 2093] string concatenation modifies original

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2093


Steven Schveighoffer  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED


--- Comment #15 from Steven Schveighoffer  2010-03-16 
19:55:38 PDT ---
This is fixed by the patch in bug 3637.  It is in dmd 2.041.

Compiling the attached file results in the desired output.

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


[Issue 3978] Compiler crash on improper struct initialization

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3978


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-03-16 18:10:41 PDT ---
I think that removing the forward reference doesn't solve the problem.

If I add this line at the end:
void main() {}
The situation changes.

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


[Issue 3976] segfault on anonymous struct/union

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3976



--- Comment #1 from Ellery Newcomer  2010-03-16 
17:35:57 PDT ---
Okay, for some reason my test case doesn't seem to be working. I'm sure it was
earlier, but I deleted the file, etc. 

I can still get the segfault with my original (humongous) code, as well as a
few others if the structs are rearranged a little. But I'm not whittling it
down again.

Here it is if anyone cares:

http://personal.utulsa.edu/~ellery-newcomer/dxl.zip

unzip it and run dmd @kmd.

the problem file is src/dxl/read/biff/FilePassRecord.d

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


[Issue 3978] New: Compiler crash on improper struct initialization

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3978

   Summary: Compiler crash on improper struct initialization
   Product: D
   Version: 2.030
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: paul.d.ander...@comcast.net


--- Comment #0 from Paul D. Anderson  2010-03-16 
17:18:14 PDT ---
The following code fragment causes the compiler to crash with the following
useful information:

"dmd.exe has encountered a problem and needs to close.  We are sorry for the
inconvenience."

//
public S s = S();

public struct S {
private int[] a = [ 0 ];
}
//

I realize the code is incorrect, but I expected an error message, not a
trainwreck.

Adding initializer information solves the problem:

//
public S s = S([0]); // compiles correctly

public struct S {
private int[] a = [ 0 ];
}
//

Eliminating the forward reference solves the problem:

//
public struct S {
private int[] a = [ 0 ];
}

public S s = S(); // compiles correctly
//

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


[Issue 2095] covariance w/o typechecks = bugs

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2095


Steven Schveighoffer  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #10 from Steven Schveighoffer  2010-03-16 
14:23:01 PDT ---
*** Issue 3977 has been marked as a duplicate of this issue. ***

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


[Issue 3977] Should disable implicit conversion of B[] to A[] when B is derived from A

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3977


Steven Schveighoffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||schvei...@yahoo.com
 Resolution||DUPLICATE


--- Comment #1 from Steven Schveighoffer  2010-03-16 
14:23:00 PDT ---
Been around for a while.

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

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


[Issue 3977] New: Should disable implicit conversion of B[] to A[] when B is derived from A

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3977

   Summary: Should disable implicit conversion of B[] to A[] when
B is derived from A
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bugzi...@digitalmars.com


--- Comment #0 from Walter Bright  2010-03-16 
14:17:50 PDT ---
This exposes a potential memory corruption problem:

class A {}
class B : A {}
void proc(A[] x, A y) {
x[0] = y;
}
void main() {
B[] anArrayOfB = new B[5];
A a = new A();
proc(anArrayOfB, a);
}

The solution is to disable implicit conversion of B[] to A[], but B[] to
const(A)[] and immutable(B)[] to immutable(A)[] should be allowed.

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


[Issue 3972] Regarding module with name different from its file name

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3972


Don  changed:

   What|Removed |Added

   Keywords||patch
 CC||clugd...@yahoo.com.au


--- Comment #1 from Don  2010-03-16 13:58:43 PDT ---
I actually hit this today and got sufficiently irritated to improve the error
message a bit. The 'else' clause should also be improved, it's bug 2059
("Horrible error message"). Perhaps change it to (untested):
error(loc, "has inconsistent naming. It was imported as %s", srcname);


Index: module.c
===
--- module.c(revision 416)
+++ module.c(working copy)
@@ -621,7 +621,10 @@
 if (!dst->insert(this))
 {
 if (md)
-error(loc, "is in multiple packages %s", md->toChars());
+{
+error(loc, "has inconsistent naming.\n"
+"It was imported as %s but module declaration is %s", srcname,
md->toChars());
+}
 else
 error(loc, "is in multiple defined");
 }

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


[Issue 3965] Multiple "static this()" can be a little error-prone

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3965


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||WONTFIX


--- Comment #3 from Walter Bright  2010-03-16 
13:03:58 PDT ---
I believe this is a valuable feature for D. Sure, you can write convoluted code
with it, but so you can in general with any programming construct. Forcing it
all into one static constructor can also be confusing, because it takes away
locality of operations, which can cause its own confusion.

Won't implement.

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


[Issue 3976] New: segfault on anonymous struct/union

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3976

   Summary: segfault on anonymous struct/union
   Product: D
   Version: 1.057
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer  2010-03-16 
12:24:31 PDT ---
struct A{
struct{
B b;
C c;
}
}
struct B{
int i;
}
struct C{
int j;
}

and DMD bombs out. Seems to be a forward referencing problem, as the
AnonDeclaration's scope never gets set.

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


[Issue 3975] New: Misnamed main causes linker errors

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3975

   Summary: Misnamed main causes linker errors
   Product: D
   Version: 1.057
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: baseball@gmail.com


--- Comment #0 from Michael P  2010-03-16 08:15:49 PDT 
---
typo.d:
void mann() { }

mich...@michael-laptop:~/d/projects$ dmd typo.d
/home/michael/dmd/linux/bin/../lib/libphobos.a(dmain2_7a_1a5.o): In function
`main':
internal/dmain2.d:(.text.main+0x74): undefined reference to `_Dmain'
internal/dmain2.d:(.text.main+0xc5): undefined reference to `_Dmain'
/home/michael/dmd/linux/bin/../lib/libphobos.a(deh2_171_525.o): In function
`_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable':
internal/deh2.d:(.text._D4deh213__eh_finddataFPvZPS4deh213DHandlerTable+0x4):
undefined reference to `_deh_beg'
internal/deh2.d:(.text._D4deh213__eh_finddataFPvZPS4deh213DHandlerTable+0xc):
undefined reference to `_deh_beg'
internal/deh2.d:(.text._D4deh213__eh_finddataFPvZPS4deh213DHandlerTable+0x13):
undefined reference to `_deh_end'
internal/deh2.d:(.text._D4deh213__eh_finddataFPvZPS4deh213DHandlerTable+0x37):
undefined reference to `_deh_end'
collect2: ld returned 1 exit status
--- errorlevel 1

Should this be happening?
Compiling with -c is fine, and produces no output.

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


[Issue 3974] ICE(init.c): Static array initializer with more elements than destination array

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3974


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-03-16 05:20:36 PDT ---
Regarding bug 3849, I did put both things in the same bug report because:
- they are strongly semantically related, the compiler has to refuse fixed
sized literals with a number of items different from the number specified on
the left (this is true for nD arrays too);
- The cause of this ICE can be related to the lack of tests over the number of
items in the literal compared to the number on the left. So fixing one bug can
even fix the other too, or it can be very quick to fix one when you fix the
other. That's why I have not originally marked that as enhancement.

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


[Issue 3849] [missing error] Array literal length doesn't match

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3849


Don  changed:

   What|Removed |Added

   Keywords|ice-on-invalid-code |
 CC||clugd...@yahoo.com.au
   Severity|normal  |enhancement


--- Comment #2 from Don  2010-03-16 01:09:43 PDT ---
I've moved the ICE in the comment to bug 3974. The original issue is an
enhancement.

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


[Issue 3974] New: ICE(init.c): Static array initializer with more elements than destination array

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3974

   Summary: ICE(init.c): Static array initializer with more
elements than destination array
   Product: D
   Version: 2.040
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don  2010-03-16 01:08:35 PDT ---
Reported in a comment in bug 3849.

void main() {
  struct S { int x; }
  S[2] a = [{1}, {2}, {3}];
}

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


[Issue 3884] Segfault: defining a typedef with an invalid object.d

2010-03-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3884


Don  changed:

   What|Removed |Added

   Keywords||patch


--- Comment #3 from Don  2010-03-16 01:02:39 PDT ---
This is really obscure, but here's a patch:
typeinf.c, line 108:

Expression *Type::getTypeInfo(Scope *sc)
{
Expression *e;
Type *t;
+if (!Type::typeinfo)
+{
+error(0, "TypeInfo not found. object.d may be incorrectly installed or
corrupt");
+return new ErrorExp();
+}

//printf("Type::getTypeInfo() %p, %s\n", this, toChars());

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