[Issue 5931] keyword new insists on calling a struct's (non-zero argument) constructor--in other words, it won't allow default initialization; also postblit this(this) constructor dosen't get called f

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #2 from kenn...@gmail.com 2011-05-06 01:46:03 PDT ---
Post-blit is only called when you override the whole structure, as in:


import std.stdio;

struct S {
this(this) {
writeln(postblit);
}
}

void main() {
S s;
S t;
s = t;// -- call postblit on s.
}


Pointer-assignment will *not* call post-blit as you have not blitted
(memcpy-ed) anything.

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


[Issue 5932] Internal error: s2ir.c 339

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


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

   What|Removed |Added

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


--- Comment #1 from Don clugd...@yahoo.com.au 2011-05-06 01:47:34 PDT ---
This is probably related to bug 4910, and also to bug 4269 (invalid type
accepted if evaluated while errors are gagged)

There's a problem with the gagging system.

One difficulty is that if there has been a forward reference, CTFE needs to run
semantic3 on the function. If errors are gagged from inside
VarDeclaration::semantic, the gagging should only apply to CTFE; the semantic3
errors should not be gagged.
The problem is, the gagging system doesn't have any mechanism for ungagging.
If we instantiated a template from inside is(typeof()), semantic errors should
be gagged; we don't yet know if the template will be instantiated. Let's call
this an investigative template instantiation. This is recursive; any template
instantiated from inside a investigative template is also investigative.
BUT, any semantic run on anything other than a investigative template should
NOT be gagged. The simple incrementing and decrementing of global.gag doesn't
quite work.

The other side of the problem is bug 4269: failed templates are not removed. If
there is an attempt to instantiate them from a non-gagged state, the original
(previously suppressed) error messages should be shown.

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


[Issue 5907] CTFE: Ref assignments are noop at compile time

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


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||DUPLICATE


--- Comment #2 from Don clugd...@yahoo.com.au 2011-05-06 01:48:14 PDT ---
dup of 1330, which is fixed.

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

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


[Issue 1330] Array slicing does not work the same way in CTFE as at runtime

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


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

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #4 from Don clugd...@yahoo.com.au 2011-05-06 01:48:15 PDT ---
*** Issue 5907 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 5760] Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at object._checkModCtors._findDependencies.object.ModuleInfo

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


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

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||INVALID


--- Comment #2 from Don clugd...@yahoo.com.au 2011-05-06 01:49:08 PDT ---
INVALID, probably a dirty build.
The dependencies in DMD's makefile aren't complete, if you don't do 'make
clean' you're quite likely to get a subtly wrong build. Could also be a bad .di
file (you need to do 'make import' on druntime).

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


[Issue 5867] Cannot put function attributes (const, pure, ...) on the right of an auto-return function

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


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #1 from kenn...@gmail.com 2011-05-06 01:59:06 PDT ---
*** This issue has been marked as a duplicate of issue 4865 ***

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


[Issue 4865] Post-position attributes cannot be used with auto return functions

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #1 from kenn...@gmail.com 2011-05-06 01:59:11 PDT ---
*** Issue 5867 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 4865] Post-position attributes cannot be used with auto return functions

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


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #2 from kenn...@gmail.com 2011-05-06 02:02:17 PDT ---
*** This issue has been marked as a duplicate of issue 4040 ***

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


[Issue 4040] const/immutable on the right in auto return class methods

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||samu...@voliacable.com


--- Comment #1 from kenn...@gmail.com 2011-05-06 02:02:17 PDT ---
*** Issue 4865 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 5933] New: Cannot retrieve the return type of an auto-return member function

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

   Summary: Cannot retrieve the return type of an auto-return
member function
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-05-06 02:19:58 PDT ---
Test case:

--
struct X {
auto x() {
return 0; 
}
}
pragma(msg, typeof(X.init.x));
static assert(is(typeof(X.init.x) == int delegate()));
--
()
x.d(7): Error: static assert  (is(typeof(__error) == int delegate())) is false
--

The expected output is 'int()' and the static assert should pass. The '__error'
comes out because DMD thinks X.init.x is forward-referenced.




This also causes a ICE when using with std.traits.ReturnType:

--
struct X {
auto x() {
return 0; 
}
}
static if (is(typeof(X.init.x) R == return)) {}
--
Assertion failed: (type), function AliasDeclaration, file declaration.c, line
376.
Abort trap
--

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


[Issue 5891] hasLength!iota is false

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



--- Comment #3 from kenn...@gmail.com 2011-05-06 02:21:58 PDT ---
(In reply to comment #2)
 Of course the DMD bug should be fixed but Iota is too important to fail, so
 this specific case has been worked around:
 
 https://github.com/D-Programming-Language/phobos/commit/9c7fe081f8ec5cec6822f3801b3dee6a85d22e45

OK. The DMD bug is now filed as issue 5933.

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


[Issue 5258] [CTFE] Stack overflow with struct by ref

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

   Severity|normal  |regression


--- Comment #1 from bearophile_h...@eml.cc 2011-05-06 02:51:16 PDT ---
This CTFE bug is present in DMD v1.068beta still, but it seems absent in DMD
v1.042.

A longer example that gives the correct answer with DMD 1.042 but produces
stack overflow with DMD v1.068beta:


import std.c.stdio: printf;

bool test(int k, int j, ulong diag45, ulong diag135, ulong cols) {
return ((cols (1UL  j)) +
(diag135  (1UL  (j + k))) +
(diag45   (1UL  (32 + j - k))) ) == 0;
}

void mark(int k, int j, ref ulong diag45, ref ulong diag135, ref ulong cols) {
cols^= (1UL  j);
diag135 ^= (1UL  (j + k));
diag45  ^= (1UL  (32 + j - k));
}

uint solve(int niv, int dx, ref ulong diag45, ref ulong diag135, ref ulong
cols) {
uint solutions_found;

if (niv) {
for (int i = 0; i  dx; i++)
if (test(niv, i, diag45, diag135, cols)) {
mark(niv, i, diag45, diag135, cols);
solutions_found += solve(niv - 1, dx, diag45, diag135, cols);
mark(niv, i, diag45, diag135, cols);
}
} else {
for (int i = 0; i  dx; i++)
solutions_found += test(0, i, diag45, diag135, cols);
}

return solutions_found;
}

ulong nqueen(int n) {
// masques
ulong diag45  = 0; // / diagonal bitboard
ulong diag135 = 0; // \ diagonal bitboard
ulong cols= 0; // column bitboard

return solve(n - 1, n, diag45, diag135, cols);
}

const ulong result = nqueen(9);

void main() {
// NQUEENS: 1, 0, 0, 2, 10, 4, 40, 92, 352, 724, 2_680, 14_200, 73_712,
365_596
printf(%lld\n, result);
}

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


[Issue 5258] [CTFE] Stack overflow with struct by ref

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



--- Comment #2 from Don clugd...@yahoo.com.au 2011-05-06 04:09:57 PDT ---
This is a pseudo-regression: it was never doing what it was supposed to. The
test case happened to give the correct results on a previous version, but only
because one bug hid another. Slight changes would make it fail.

Ref parameters are not going to work reliably in CTFE until pointers are
implemented. Which is not happening in this release.

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


[Issue 5810] Struct postincrement generates 'no effect' error if used on struct member

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


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

   What|Removed |Added

   Keywords||diagnostic
 CC||clugd...@yahoo.com.au
Summary|BigInt++ 'no effect'|Struct postincrement
   |problem |generates 'no effect' error
   ||if used on struct member


--- Comment #1 from Don clugd...@yahoo.com.au 2011-05-06 04:17:21 PDT ---
It's nothing to do with BigInt. Here's a reduced test case:

struct Bug5810 {
void opUnary(string op)(){ }
}

struct Foo {
Bug5810 x;
void bar() { x++; }
}

test2.d(13): Error: var has no effect in expression (__pitmp4)

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


[Issue 5934] New: Finite recursive templates are not allowed

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

   Summary: Finite recursive templates are not allowed
   Product: D
   Version: D2
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: maxim...@gmail.com


--- Comment #0 from Maksim Zholudev maxim...@gmail.com 2011-05-06 06:22:45 
PDT ---
Finite recursion in parametrized structures produces compilation errors.

This kind of recursion could be used to implement custom compile-time
expression parsing for user-defined types.
It should be limited but not forbidden.

Example:
--
struct Foo
{
auto opUnary(string op)()
if(op == -)
{
return Negation!(typeof(this))(this);
}
}

struct Negation(T)
{
T statement;

auto opUnary(string op)()
if(op == -)
{
return Negation!(typeof(this))(this);
}
}

void main()
{
Foo a;
auto b = -a; // no errors
auto c = -(-a); /* Error: recursive template expansion for template
 *argument Negation!(Foo)
 */
}
--

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


[Issue 5935] New: Non-tuple iteration with std.range.zip

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

   Summary: Non-tuple iteration with std.range.zip
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: patch
  Severity: enhancement
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2011-05-06 07:37:46 PDT ---
Zip sequence should provide non-tuple version foreach like this:

foreach (i, c; zip(sequence!n(), str))
{
 if (i==0) assert(c == 's');
else if (i==1) assert(c == 't');
else if (i==2) assert(c == 'r');
else assert(0);
}


Patch:

 std/range.d |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/std/range.d b/std/range.d
index 7e7916c..0a24500 100644
--- a/std/range.d
+++ b/std/range.d
@@ -3209,6 +3209,21 @@ if(Ranges.length  allSatisfy!(isInputRange,
staticMap!(Unqual, Ranges)))
 }
 }
 }
+
+/**
+   Iterate zip elements with directry named heads of ranges.
+ */
+int opApply(int delegate(ref ElementType.Types) dg)
+{
+auto r = this;
+for (; !r.empty; r.popFront())
+{
+auto e = r.front;
+if (auto result = dg(e.field))
+return result;
+}
+return 0;
+}
 }

 /// Ditto

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


[Issue 5934] Finite recursive templates are not allowed

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



--- Comment #1 from Maksim Zholudev maxim...@gmail.com 2011-05-06 07:55:47 
PDT ---
The following code works, but such workarounds are annoying:
--
struct Foo
{
auto opUnary(string op)()
if(op == -)
{
return Negation!(typeof(this))(this);
}
}

struct Negation(T)
{
T statement;

auto opUnary(string op)()
if(op == -)
{
return MakeNeg(this); // The return type is Negation!(Negation!(T))
}
}

// Function that makes the recursion implicit
auto MakeNeg(T)(T stat)
{
return Negation!(T)(stat);
}

void main()
{
Foo a;
auto b = -a; // no errors
auto c = -(-a); // no errors
}
--

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


[Issue 3869] Unreasonable error without line number: recursive template expansion

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


Maksim Zholudev maxim...@gmail.com changed:

   What|Removed |Added

 CC||maxim...@gmail.com


--- Comment #5 from Maksim Zholudev maxim...@gmail.com 2011-05-06 08:13:33 
PDT ---
*** Issue 5934 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 5934] Finite recursive templates are not allowed

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


Maksim Zholudev maxim...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE


--- Comment #2 from Maksim Zholudev maxim...@gmail.com 2011-05-06 08:13:33 
PDT ---
*** This issue has been marked as a duplicate of issue 3869 ***

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


[Issue 5936] New: DMD Segfault when forward-referencing pure auto-return member function with parameter.

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

   Summary: DMD Segfault when forward-referencing pure auto-return
member function with parameter.
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: ice-on-valid-code, rejects-valid
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com
Blocks: 340


--- Comment #0 from kenn...@gmail.com 2011-05-06 08:44:05 PDT ---
Test case:

---
import std.c.stdio;
int a() {
return V.s(0);
}
struct V {
static pure auto s(int x) {
return 55;
}
}
void main() {
printf(%d\n, a());
}
---
Bus error
---

The bug appears only if all of the following conditions are met:
 1. The function 's' must be 'pure'. 
 2. The function 's' must have auto-return.
 3. The function 's' must have at least one named parameter. For example, if
the parameter is changed to 'pure auto s(...)' the bug disappears.
 4. The function 's' must be placed after its first use. For example, moving
'struct V' above 'int a()' the bug disappears.

The program works correctly in 2.048. Therefore I have marked this as a
regression.



If instead of calling the function, we just compute the pointer of 's', we'll
get a forward reference error instead:

---
void a() {
cast(void)(V.s);
}
struct V {
static pure auto s(int x) {
return 0;
}
}
---
x.d(2): Error: forward reference to s
---

But this error also happens on 2.048.

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


[Issue 4968] inout is sticky to function return type

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



--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-05-06 09:21:13 PDT ---
Created an attachment (id=964)
test patch

This patch only fix comment#1 case, but not support more cases (array,
function, delegate, etc.)

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


[Issue 5935] Non-tuple iteration with std.range.zip

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


kenn...@gmail.com changed:

   What|Removed |Added

 CC||kenn...@gmail.com


--- Comment #1 from kenn...@gmail.com 2011-05-06 09:24:10 PDT ---
What about std.range.lockstep?

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


[Issue 5409] Disallow (!x y)

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



--- Comment #1 from bearophile_h...@eml.cc 2011-05-06 10:14:02 PDT ---
Don seems to agree in catching this bug statically:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=135741

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=135746

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


[Issue 5930] cas doesn't work when used in code compiled with -D

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


Sean Kelly s...@invisibleduck.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||s...@invisibleduck.org


--- Comment #1 from Sean Kelly s...@invisibleduck.org 2011-05-06 10:46:30 PDT 
---
Yep.  This is because core.atomic has stub functions for documentation purposes
inside version(D_Ddoc) blocks.  There was some talk about Phobos and Druntime
moving to a different convention for documentation though.  I'll see about
fixing this for 2.054, since 2.053 is almost in the can.

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


[Issue 5872] core.demangle, core.sys.*, core.stdc.* not documented

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


Sean Kelly s...@invisibleduck.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||s...@invisibleduck.org


--- Comment #1 from Sean Kelly s...@invisibleduck.org 2011-05-06 10:56:50 PDT 
---
I'll take care of core.demangle.  core.sys.* and core.stdc.* are interfaces for
C libraries and I'd expect the user to refer to the documentation for those
libraries directly.  Documenting that stuff would be a tremendous amount of
work and risks copyright violation if I simply paste it in from the reference
docs.

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


[Issue 5935] Non-tuple iteration with std.range.zip

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


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 CC||and...@metalanguage.com


--- Comment #3 from Andrei Alexandrescu and...@metalanguage.com 2011-05-06 
11:18:36 PDT ---
I'm worried about this development. Before long we could get to the point where
a lot of ranges get bloated to support two iteration methods because opApply
has capabilities that ranges don't.

To prevent that we should improve range-based iteration to provide good support
for foreach, and leave opApply to entities that need internal iteration.

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


[Issue 5872] core.demangle, core.sys.*, core.stdc.* not documented

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



--- Comment #2 from kenn...@gmail.com 2011-05-06 11:21:47 PDT ---
(In reply to comment #1)
 I'll take care of core.demangle.  core.sys.* and core.stdc.* are interfaces 
 for
 C libraries and I'd expect the user to refer to the documentation for those
 libraries directly.  Documenting that stuff would be a tremendous amount of
 work and risks copyright violation if I simply paste it in from the reference
 docs.

Well, at least mention what modules are inside these subpackages (e.g. it is
core.sys.posix.setjmp, not core.stdc.setjmp).

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


[Issue 5935] Non-tuple iteration with std.range.zip

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



--- Comment #4 from kenn...@gmail.com 2011-05-06 11:26:58 PDT ---
(In reply to comment #3)
 I'm worried about this development. Before long we could get to the point 
 where
 a lot of ranges get bloated to support two iteration methods because opApply
 has capabilities that ranges don't.
 
 To prevent that we should improve range-based iteration to provide good 
 support
 for foreach, and leave opApply to entities that need internal iteration.

Implement (a subset of) issue 4579?

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


[Issue 5872] core.demangle, core.sys.*, core.stdc.* not documented

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


Jacob Carlborg d...@me.com changed:

   What|Removed |Added

 CC||d...@me.com


--- Comment #3 from Jacob Carlborg d...@me.com 2011-05-06 11:47:13 PDT ---
How about add an empty doc comment at every declaration making the declarations
visible in the documentation. And also add a note that the user should look up
the original documentation, perhaps even with a link.

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


[Issue 5931] keyword new won't allow default initialization of a struct where it has a non-zero argument constructor

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


Christopher the Magnificent ultimatemacfana...@gmail.com changed:

   What|Removed |Added

Summary|keyword new insists on  |keyword new won't allow
   |calling a struct's  |default initialization of a
   |(non-zero argument) |struct where it has a
   |constructor--in other   |non-zero argument
   |words, it won't allow   |constructor
   |default initialization; |
   |also postblit this(this)|
   |constructor dosen't get |
   |called from new|
   |structname(struct_instan |
   |ce)   |


--- Comment #3 from Christopher the Magnificent ultimatemacfana...@gmail.com 
2011-05-06 12:32:02 PDT ---
(In reply to comment #2)
 Post-blit is only called when you override the whole structure, as in:
 
 
 import std.stdio;
 
 struct S {
 this(this) {
 writeln(postblit);
 }
 }
 
 void main() {
 S s;
 S t;
 s = t;// -- call postblit on s.
 }
 
 
 Pointer-assignment will *not* call post-blit as you have not blitted
 (memcpy-ed) anything.


*Shouldn't* post-blit be invokable by calling File(file)?  Wouldn't this be a
desirable behavior?

If not, how do I allocate a default-initialized File struct in the heap using
new  (so that I can follow that by overwriting the whole structure and get
post-blitter to run)?

what I'm taking about is this (this is what I want to do):


import std.stdio;

struct Tokenizer
{
File* file = null;

void 
initFile(File f)
{
this.file = new File;   // I want to allocate a new File struct and set
it to File.init -- DOESNT WORK!
*this.file = f;  // copy bits and then automatically call
post-blit File.this(this) 
}
}


At the line above marked DOESN'T WORK, the compiler refuses to allocate a new
default-initialized File struct.  This is a problem

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


[Issue 5931] keyword new won't allow default initialization of a struct where it has a non-zero argument constructor

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



--- Comment #4 from kenn...@gmail.com 2011-05-06 12:47:28 PDT ---
(In reply to comment #3)
 *Shouldn't* post-blit be invokable by calling File(file)?  Wouldn't this be 
 a
 desirable behavior?
 

Sorry, got distracted by the 'this.file = new File(...)' part because of your
'File file;' :).

No it should not call post-blit directly, because is possible to *declare* such
a constructor. The problem is, should D define the implicitly-defined copy
constructor which does:

struct S {
  this(ref S s) {
this = s;  // implicitly calls the postblit
  }
  ...
}

?

[snip]
 At the line above marked DOESN'T WORK, the compiler refuses to allocate a 
 new
 default-initialized File struct.  This is a problem

This problem is the same as issue 4249.

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


[Issue 5931] keyword new won't allow default initialization of a struct where it has a non-zero argument constructor

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



--- Comment #5 from kenn...@gmail.com 2011-05-06 12:48:43 PDT ---
(In reply to comment #4)
 (In reply to comment #3)
[snip]
  At the line above marked DOESN'T WORK, the compiler refuses to allocate a 
  new
  default-initialized File struct.  This is a problem
 
 This problem is the same as issue 4249.

I mean issue 4247 -.-

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


[Issue 5937] New: Problem with map!delegate(iota(floating point))

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

   Summary: Problem with map!delegate(iota(floating point))
   Product: D
   Version: D2
  Platform: x86
OS/Version: Windows
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-05-06 15:14:07 PDT ---
With DMD 2.052 this gives some access violations:


import std.range, std.algorithm;
void main() {
auto range1 = iota(0.0, 5.0, 1.0);
double foo(double x){ return 1.0; };
auto foor = map!foo(range1);
foreach (x; foor) {} // OK

auto range2 = iota(1, 5, 1);
int bar(int x){ return 1; };
auto barr = map!bar(range2);
foreach (x; barr) {} // OK

float delegate(float) spam1 = (float x){ return 1.0f; };
auto spamr1 = map!spam1(range1);
foreach (x; spamr1) {} // object.Error: Access Violation

double delegate(double) spam2 = (double x){ return 1.0; };
auto spamr2 = map!spam1(range1);
foreach (x; spamr2) {} // object.Error: Access Violation

real delegate(real) spam3 = (real x){ return 1.0L; };
auto spamr3 = map!spam3(range1);
foreach (x; spamr3) {} // object.Error: Access Violation
}

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


[Issue 5937] Problem with map!delegate(iota(floating point))

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



--- Comment #1 from bearophile_h...@eml.cc 2011-05-06 15:18:27 PDT ---
A better example for the second (bar) case, the problem seems in iota():


import std.range, std.algorithm;
void main() {
auto range2a = iota(1, 5, 1);
int delegate(int) bar1 = (int x){ return 1; };
auto barr1 = map!bar1(range2a);
foreach (x; barr1) {} // OK

auto range2b = iota(1, 5, 1);
double delegate(double) bar2 = (double x){ return 1.0; };
auto barr2 = map!bar2(range2b);
foreach (x; barr2) {} // OK
}

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


[Issue 5490] DMDFE: Slim down warnings generated by GCC

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



--- Comment #12 from Iain Buclaw ibuc...@ubuntu.com 2011-05-06 16:10:49 PDT 
---
GCC-4.6 offers two new warning switches to catch redundant code:
-Wunused-but-set-parameter and -Wunused-but-set-variable

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


[Issue 4968] inout is sticky to function return type

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


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

   What|Removed |Added

 Attachment #964 is|0   |1
   obsolete||


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2011-05-06 22:14:25 PDT ---
Created an attachment (id=965)
Improvement

Posted pull request:
https://github.com/D-Programming-Language/dmd/pull/58

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


[Issue 5938] New: ICE ztc\symbol.c 1043

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

   Summary: ICE ztc\symbol.c 1043
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: ice-on-valid-code
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-05-06 22:19:25 PDT ---
DMD 2.053 beta

import std.stdio;

void main() {
string filename = foo.txt;
auto handle = (filename == stdin) ? stdin : File(filename);
}

Results:

Internal error: ..\ztc\symbol.c 1043

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


[Issue 5939] New: Cannot copy std.algorithm.map

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

   Summary: Cannot copy std.algorithm.map
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-05-06 22:35:37 PDT ---
import std.algorithm;

void fun(T)(T x) {
T xSaved;
}


unittest {
double[] x;
fun(map!a * a(x));
}

DMD 2.053 beta:
test9.d(4): Error: function std.algorithm.map!(a * a).map!(double[]).map is a
nested function and cannot be accessed from __unittest1
test9.d(4): Error: function std.algorithm.map!(a * a).map!(double[]).map is a
nested function and cannot be accessed from fun

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


[Issue 5940] New: Cannot create arrays of std.algorithm.map

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

   Summary: Cannot create arrays of std.algorithm.map
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2011-05-06 22:38:00 PDT ---
import std.algorithm;

void main() {
auto stuff =
[map!a * 2([1, 2, 3]),
 map!a * 2([4, 5, 6])
];
}

Result on DMD 2.053 beta:

test9.d(5): Error: cannot have array of inner structs Result

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