[Issue 2070] DMD should allow easy creation of stack-allocated classes

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2070


nfx...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||nfx...@gmail.com
 Resolution||WONTFIX


--- Comment #6 from nfx...@gmail.com 2010-06-01 22:55:27 PDT ---
According to Andrei, scope will be completely removed from D2:
http://lists.puremagic.com/pipermail/digitalmars-d/2010-June/076766.html

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


[Issue 3854] Error on static initialization of arrays with trailing comma.

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3854


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2010-06-01 
23:52:32 PDT ---
http://www.dsource.org/projects/dmd/changeset/514

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


[Issue 1193] regression: matches more than one template declaration doesn't list the location of the conflicting templates

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1193


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2010-06-02 
00:49:58 PDT ---
http://www.dsource.org/projects/dmd/changeset/515

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


[Issue 4231] Solitary opUnary Postincrement and Postdecrement user defined operators are broken.

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4231



--- Comment #5 from Andrei Alexandrescu and...@metalanguage.com 2010-06-02 
08:57:50 PDT ---
That looks like a very specialized optimization to me. In particular, if the
postblit has side effects, the optimizer must have advanced knowledge in order
to elide it. This is a path that C++ has taken with copy constructor elision,
and it's not a path we should take.

I think the language definition should clarify that postincrement and
postdecrement are lowered into their pre- counterparts if the result is not
taken.

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


[Issue 4231] Solitary opUnary Postincrement and Postdecrement user defined operators are broken.

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4231



--- Comment #6 from Brad Roberts bra...@puremagic.com 2010-06-02 10:22:56 PDT 
---
I was thinking about the code post-inlining.  MOST of the time the operators
will be inlined and at that point it should be dead simple for it to eliminate
dead stores and thus the temporaries would just go away, no special knowledge
or techniques required.  Without inlining, yeah, it can't make assumptions what
can occur inside the function calls.

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


[Issue 4231] Solitary opUnary Postincrement and Postdecrement user defined operators are broken.

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4231



--- Comment #7 from Andrei Alexandrescu and...@metalanguage.com 2010-06-02 
10:53:53 PDT ---
(In reply to comment #6)
 I was thinking about the code post-inlining.  MOST of the time the operators
 will be inlined and at that point it should be dead simple for it to eliminate
 dead stores and thus the temporaries would just go away, no special knowledge
 or techniques required.  Without inlining, yeah, it can't make assumptions 
 what
 can occur inside the function calls.

Inlining is irrelevant. If a this(this) has a writeln() in it, the optimizer
must honor it no questions asked. That's why elision must come from a higher
level.

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


[Issue 3547] for option -od for relative path the path is added twice

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3547


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2010-06-02 
10:56:47 PDT ---
http://www.dsource.org/projects/dmd/changeset/516

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


[Issue 1394] Regex does not support forgetfull matching (?:.......

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1394


Jesse Phillips jesse.k.phillip...@gmail.com changed:

   What|Removed |Added

   Keywords||patch
 CC||jesse.k.phillip...@gmail.co
   ||m


--- Comment #1 from Jesse Phillips jesse.k.phillip...@gmail.com 2010-06-02 
10:59:39 PDT ---
Adding the patch keyword as the original comment contained one.

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


[Issue 4231] Solitary opUnary Postincrement and Postdecrement user defined operators are broken.

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4231



--- Comment #8 from Brad Roberts bra...@puremagic.com 2010-06-02 11:19:00 PDT 
---
(In reply to comment #7)
 Inlining is irrelevant. If a this(this) has a writeln() in it, the optimizer
 must honor it no questions asked. That's why elision must come from a higher
 level.

It's entirely relevant for the original issue: removal of unnecessary
temporaries.  Yes, there are opportunities for the language to define away some
parts, but that's a separate discussion for a separate bug report.

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


[Issue 4249] std.regex fails to compile with debug=regex

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4249


Masahiro Nakagawa repeate...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||repeate...@gmail.com
 Resolution||FIXED


--- Comment #1 from Masahiro Nakagawa repeate...@gmail.com 2010-06-02 
12:30:28 PDT ---
changeset 1573. Thanks for the patch!

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


[Issue 4235] !in not working (D1)

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4235



--- Comment #4 from Random Name dbu...@yahoo.com 2010-06-02 13:57:00 PDT ---
I should not have posted about that crash in this report because it's probably
unrelated to !in. The way I can reproduce it in my code is if I modify a string
mixin from !(something in arr) to something !in arr. I have not tried to make a
minimal test case for it but a single const string with a mixin statement might
be enough.

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


[Issue 3308] Enum.RED.stringof gives Enum, not Enum.RED

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3308


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2010-06-02 14:48:13 PDT ---
See also bug 4261

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


[Issue 4261] New: Bad textual printing of enums

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4261

   Summary: Bad textual printing of enums
   Product: D
   Version: unspecified
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-06-02 14:47:27 PDT ---
This D2 program:

import std.stdio: writeln;
void main() {
enum Foo { Zero, One }
Foo f = Foo.One;
writeln(f);
}


With DMD v2.046 prints:
1

But it's better for it to print:
One


See also bug 3308.

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


[Issue 4262] New: Header generation omits 'enum' for enum declarations

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4262

   Summary: Header generation omits 'enum' for enum declarations
   Product: D
   Version: 2.040
  Platform: x86
OS/Version: Mac OS X
Status: NEW
  Severity: blocker
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: s...@invisibleduck.org


--- Comment #0 from Sean Kelly s...@invisibleduck.org 2010-06-02 15:30:42 PDT 
---
Yet another blocker for druntime I'm afraid.  Given:

enum x = 1;

The generated header will be:

x = 1;

Patch included.

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


[Issue 4257] ICE(interpret.c): passing parameter into CTFE as ref parameter

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4257


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2010-06-02 
15:34:10 PDT ---
http://www.dsource.org/projects/dmd/changeset/517

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


[Issue 3809] Struct initializers apparently always CTFE'd, and incorrectly

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3809


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

   Keywords|wrong-code  |
 CC||bugzi...@digitalmars.com


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2010-06-02 
15:37:10 PDT ---
http://www.dsource.org/projects/dmd/changeset/517 turns it into rejects-valid

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


[Issue 4264] New: Various std.algorithm.map problems

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4264

   Summary: Various std.algorithm.map problems
   Product: D
   Version: unspecified
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-06-02 17:21:38 PDT ---
This D2 code works with DMD v2.046:

import std.stdio: writeln;
import std.algorithm: array, map;
void main() {
int[] arr = [1, 2, 3];
auto r1 = map!(a * a)(arr);
writeln(array(r1));

auto f = (int x){ return x * x; };
auto r2 = map!(f)(arr);
writeln(array(r2));
}

And prints:

1 4 9
1 4 9

--

But this program:

import std.stdio: writeln;
import std.algorithm: array, map;
void main() {
int[] arr = [1, 2, 3];
auto r3 = map!((x){ return x * x; })(arr);
writeln(array(r3));
}


Generates the errors at compile-time:
...\src\phobos\std\algorithm.d(127): Error: forward reference to inferred
return type of function call __dgliteral1(0)
test.d(118): Error: template instance test.main.Map!(__dgliteral1,int[]) error
instantiating
test.d(5):instantiated from here: map!(int[])
test.d(5): Error: template instance test.main.map!(__dgliteral1).map!(int[])
error instantiating

--

And this program:

import std.stdio: writeln;
import std.algorithm: array, map;
void main() {
int[] arr = [1, 2, 3];
auto r4 = map!((int x){ return x * x; })(arr);
writeln(array(r4));
}


Generates the errors at compile-time:
test.d(5): Error: delegate std.algorithm.__dgliteral1 cannot access frame of
function __dgliteral1
test.d(5): Error: delegate std.algorithm.__dgliteral1 cannot access frame of
function __dgliteral1
test.d(5): Error: template instance test.main.map!(delegate int(int x)

{

return x * x;

}

) error instantiating

--

This D2 code works:

import std.stdio: writeln;
import std.algorithm: filter, array, map;
void main() {
int[] arr = [1, 2, 3, 4, 5];
auto r1 = array(filter!((x){ return x = 3; })(arr));
auto r2 = map!(a * a)(r1);
writeln(array(r2));
}


And prints:

9 16 25

--

While this code:

import std.stdio: writeln;
import std.algorithm: filter, array, map;
void main() {
int[] arr = [1, 2, 3, 4, 5];
auto r1 = filter!((x){ return x = 3; })(arr);
auto r2 = map!(a * a)(r1);
writeln(array(r2));
}


Generates the errors at compile-time:
...\src\phobos\std\algorithm.d(126): Error: struct
std.algorithm.Map!(result,Filter!(__dgliteral1,int[])).Map inner struct Filter
cannot be a field
...\src\phobos\std\algorithm.d(118): Error: template instance
std.algorithm.Map!(result,Filter!(__dgliteral1,int[])) error instantiating
test.d(6):instantiated from here: map!(Filter!(__dgliteral1,int[]))
...\src\phobos\std\algorithm.d(6): Error: template instance
std.algorithm.map!(a * a).map!(Filter!(__dgliteral1,int[])) error
instantiating

--

This code:


import std.stdio: writeln;
import std.algorithm: array, map;
struct Range {
int stop;
int opApply(int delegate(ref int) dg) {
int result;

for (int i = 0; i  stop; i++) {
result = dg(i);
if (result)
break;
}

return result;
}
}
void main() {
auto r = map!(a * a)(Range(6));
writeln(array(r));
}



Generates the errors at compile-time:
...\src\phobos\std\algorithm.d(118): Error: template instance
Map!(result,Range) does not match template declaration Map(alias fun,Range) if
(isInputRange!(Range))
...\src\phobos\std\algorithm.d(118): Error: Map!(result,Range) is used as a
type
...\src\phobos\std\algorithm.d(120): Error: function expected before (), not
void of type void
...\src\phobos\std\algorithm.d(18): Error: template instance
std.algorithm.map!(a * a).map!(Range) error instantiating
test.d(18): Error: variable test.main.r voids have no value
test.d(18): Error: expression map((Range(6))) is void and has no value


A map() from a standard library must work with that Range() too because I have
structs/classes that define opApply and I want to use map and filter on them
too.

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


[Issue 4265] New: It should be possible to query template parameters with __traits

2010-06-02 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4265

   Summary: It should be possible to query template parameters
with __traits
   Product: D
   Version: future
  Platform: Other
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: nfx...@gmail.com


--- Comment #0 from nfx...@gmail.com 2010-06-02 20:33:10 PDT ---
Consider you have

struct(T1, T2) Foo {
} 

alias Foo!(int, float) X;

You should be able to extract (int, float) from X.
Often it is possible to get the parameters indirectly from members, but there
doesn't seem to be a way to do this in the general case.

I suggest:

__traits(getTemplateParameters, X)

which would yield  a (int, float) tuple.

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