[Issue 5919] New: The declaration of static members depend in the order

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5919

   Summary: The declaration of static members depend in the order
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: rayerd@gmail.com


--- Comment #0 from Haruki Shigemori  2011-05-03 02:03:06 
PDT ---
class C
{
static ushort x = y;
static const ushort y = 1;
}

void main() {}

main.d(3): Error: variable y cannot be read at compile time

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


[Issue 5920] New: Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920

   Summary: Cannot create std.algorithm.Array of structs with
custom destructor (hasElaborateDestructor).
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: patch, rejects-valid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-05-03 02:26:41 PDT ---
Test case:

---
import std.container;
struct S {
~this() {}
}
alias Array!S A;
void main() {}
---
/usr/include/phobos/std/container.d(1506): Error: function
std.container.Array!(S).Array.clear () is not callable using argument types (S)
/usr/include/phobos/std/container.d(1506): Error: function
std.container.Array!(S).Array.clear () is not callable using argument types (S)
/usr/include/phobos/std/container.d(1506): Error: this for clear needs to be
type Array not type Payload
/usr/include/phobos/std/container.d(1506): Error: expected 0 arguments, not 1
for non-variadic function type void()
/usr/include/phobos/std/container.d(1506): Error: cannot pass types that need
destruction as variadic arguments
---

Line 1506 of std.container calls the method 'clear()' on a variable 'e', which
I think it should call the global function '.clear()' (this again shows the
name 'clear()' is bad.)

The fix is to add back the missing dot:

-
diff --git a/std/container.d b/std/container.d
index 94f6ef6..df89c2f 100755
--- a/std/container.d
+++ b/std/container.d
@@ -1503,7 +1503,7 @@ struct Array(T) if (!is(T : const(bool)))
 {
 foreach (ref e; _payload.ptr[newLength ..
_payload.length])
 {
-clear(e);
+.clear(e);
 }
 }
 _payload = _payload.ptr[0 .. newLength];
-


Because of this bug (and issue 5792), an Array of Array cannot be created.

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


[Issue 5921] New: No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921

   Summary: No mismatched nested comments
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: major
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-05-03 02:54:41 PDT ---
D2 program:


/+
/*
*/+/
void main() {}


DMD 2.052 prints (with no line number):
Error: Source:Mismatched nested comments in test.d


Tagged as 'major' because Don (almost) asked me to do this in a comment to bug
5745

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


[Issue 5922] New: immutable and static variables usage in asm{}

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5922

   Summary: immutable and static variables usage in asm{}
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-05-03 03:04:41 PDT ---
I am not sure about the errors shown here (so no keywords). Please close this
bug report if things here are working as expected.

D2 code:


void main() {
immutable size_t x = 10;
asm {
mov EDI, x;
}
}


DMD 2.052 shows the error:
test.d(2): Error: Integer constant expression expected instead of x = 10u

--

D2 code, static (thread-local) variables can't be used in ASM:


void main() {
static size_t x = 10;
asm {
mov EDI, x;
}
}


It produces:
object.Error: Access Violation


They work using __gshared, this gives no errors:

void main() {
__gshared static size_t x = 10;
asm {
mov EDI, x;
}
}


My suggestion is to remove this source of errors. One solution may be to
disallow the direct access to static variables from asm code, avoiding this
bug.

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


[Issue 5923] New: .ptr property is not const for const arrays

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5923

   Summary: .ptr property is not const for const arrays
   Product: D
   Version: D1
  Platform: x86
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: mathias.baum...@sociomantic.com


--- Comment #0 from Mathias Baumann  
2011-05-03 04:24:48 PDT ---
Created an attachment (id=958)
testcase

see the attached testcase.

the &var[0] syntax works while the var.ptr syntax fails.

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


[Issue 5924] New: schwartzSort of Tuple!(char)[]

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5924

   Summary: schwartzSort of Tuple!(char)[]
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-05-03 04:41:04 PDT ---
D2 code:

import std.algorithm, std.typecons;
void main() {
//Tuple!(int)[] chars; // OK
Tuple!(char)[] chars; // Error
schwartzSort!((c){ return c[0]; })(chars);
}


It doesn't compile with DMD 2.052:

...\dmd\src\phobos\std\algorithm.d(5911): Error: template instance
SortedRange!(Zip!(char[],Tuple!(char)[]),myLess) does not match template
declaration SortedRange(Range,alias pred = "a < b") if
(isRandomAccessRange!(Range))
...\dmd\src\phobos\std\algorithm.d(5912): Error:
SortedRange!(Zip!(char[],Tuple!(char)[]),myLess) is used as a type


You can't sort efficiently the items of an Unicode string because in general
they don't have the same length. But a dynamic array of Tuple!(char) is
composed by items 1 byte long, and generally it's not meant to be a string. So
in this case I expect schwartzSort to be able to sort it.


Current workaround:

import std.algorithm, std.typecons;
void main() {
Tuple!(char)[] chars;
schwartzSort!((c){ return cast(int)c[0]; })(chars);
}

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


[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920



--- Comment #1 from kenn...@gmail.com 2011-05-03 05:49:55 PDT ---
Pull request #35.

https://github.com/D-Programming-Language/phobos/pull/35

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


[Issue 5792] Tuple!(real,string) fails

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5792



--- Comment #3 from kenn...@gmail.com 2011-05-03 05:50:11 PDT ---
Pull request #35.

https://github.com/D-Programming-Language/phobos/pull/35

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com
   Platform|x86 |All
 OS/Version|Windows |All
   Severity|major   |normal


--- Comment #1 from kenn...@gmail.com 2011-05-03 06:03:13 PDT ---
Cannot reproduce the error message. Please show your dmd options. I've got

x.d(6): unterminated /+ +/ comment

in 2.052, 2.042 (ideone), 1.026 (codepad) and git master with 'dmd x'. Reducing
severity back to 'normal'.

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


[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED


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


[Issue 5924] schwartzSort of Tuple!(char)[]

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5924


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com


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


[Issue 5792] Tuple!(real,string) fails

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5792


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||and...@metalanguage.com
 Resolution||FIXED


--- Comment #4 from Andrei Alexandrescu  2011-05-03 
07:24:06 PDT ---
Pulled https://github.com/D-Programming-Language/phobos/pull/35. Thanks!

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


[Issue 5920] Cannot create std.algorithm.Array of structs with custom destructor (hasElaborateDestructor).

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5920


Andrei Alexandrescu  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #2 from Andrei Alexandrescu  2011-05-03 
07:24:45 PDT ---
Pulled https://github.com/D-Programming-Language/phobos/pull/35. Thanks!

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #2 from bearophile_h...@eml.cc 2011-05-03 09:54:41 PDT ---
(In reply to comment #1)
> Cannot reproduce the error message. Please show your dmd options. I've got

Thank you, you are right, I've seen that the error message I see is generated
by the build system I use and not by DMD. DMD shows the line number.

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921


Walter Bright  changed:

   What|Removed |Added

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


--- Comment #3 from Walter Bright  2011-05-03 
10:30:56 PDT ---
Not a dmd issue, marked as invalid.

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #4 from bearophile_h...@eml.cc 2011-05-03 10:39:30 PDT ---
(In reply to comment #3)
> Not a dmd issue, marked as invalid.

But isn't it a DMD problem still? Maybe we have discussed this same problem in
past, but the comments are not mismatched here.

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #5 from kenn...@gmail.com 2011-05-03 10:58:33 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > Not a dmd issue, marked as invalid.
> 
> But isn't it a DMD problem still? Maybe we have discussed this same problem in
> past, but the comments are not mismatched here.

No they are mismatched.

Inside a /+ ... +/, the /* ... */ is not special. Therefore, the tokenizer,
using greedy match, recognizes the input as:

 /+
  /*
*
 /+
  /
void main() {}

Therefore you have two +/ unmatched.

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


[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664


wolfwood  changed:

   What|Removed |Added

 AssignedTo|nob...@puremagic.com|transmethyl+...@gmail.com


--- Comment #4 from wolfwood  2011-05-03 11:39:38 
PDT ---
fixed in this pull request.

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

(In reply to comment #3)
> (In reply to comment #2)
> > static sychronized is now broken in the DMDFE 1.067, used to work in 1.066. 
> > seems that some D2 code was merged between these two versions.
> 
> this was broken by this commit:
> https://github.com/D-Programming-Language/dmd/commit/d19e57c3f0683ac3a0b290f5b73deb86aa1a6441

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


[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664



--- Comment #5 from wolfwood  2011-05-03 11:40:23 
PDT ---
fixed in this pull request.

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

(In reply to comment #3)
> (In reply to comment #2)
> > static sychronized is now broken in the DMDFE 1.067, used to work in 1.066. 
> > seems that some D2 code was merged between these two versions.
> 
> this was broken by this commit:
> https://github.com/D-Programming-Language/dmd/commit/d19e57c3f0683ac3a0b290f5b73deb86aa1a6441

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


[Issue 5921] No mismatched nested comments

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5921



--- Comment #6 from Walter Bright  2011-05-03 
12:13:25 PDT ---
Kenny's right.

This is not a dmd bug.

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


[Issue 5925] New: Comparing associative array with a storage class (const/shared/immutable) causes segfault

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5925

   Summary: Comparing associative array with a storage class
(const/shared/immutable) causes segfault
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P2
 Component: druntime
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-05-03 12:12:32 PDT ---
Test case:

---
void main() {
const a = [4:0];
const b = [4:0];
assert(a == b);
}
---

This causes a NULL-pointer exception in _aaEqual. The problem is _aaEqual's
signature is

int _aaEqual(TypeInfo_AssociativeArray ti, AA e1, AA e2)
  // ^

but the typeid of a const AA is a TypeInfo_Const, so the 'ti.keys' used later
is invalid.

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


[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664


wolfwood  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #6 from wolfwood  2011-05-03 14:37:30 
PDT ---
Fixed by commits 80c9a57 and 7ec9a76.

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


[Issue 5664] Cannot compile static synchronized member function.

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5664


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #7 from Walter Bright  2011-05-03 
15:13:45 PDT ---
https://github.com/D-Programming-Language/dmd/commit/80c9a5722a328099b1193d4d7cf43ea9c50fd565

https://github.com/D-Programming-Language/dmd/commit/7ec9a76518512e6536ebf42a904b7bd94059e63b

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


[Issue 5560] unittests add code size when compiling with -lib and without -unittest

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5560


Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #1 from Walter Bright  2011-05-03 
15:27:36 PDT ---
The size of libphobos.a has nothing to do with the size of an executable linked
with Phobos.

Multiobj will increase the size of the library simply because there's a lot of
bookkeeping overhead for each .o file - overhead that does not go into the
executable.

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


[Issue 5560] unittests add code size when compiling with -lib and without -unittest

2011-05-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5560


Steven Schveighoffer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #2 from Steven Schveighoffer  2011-05-03 
16:14:51 PDT ---
You are right, in the final executable, the size is the same.  I'm not sure why
the discrepancy in the object file, but clearly it's not affecting the exe.

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