[Issue 4289] template struct opEquals problem
http://d.puremagic.com/issues/show_bug.cgi?id=4289 --- Comment #2 from Don clugd...@yahoo.com.au 2010-12-01 02:29:17 PST --- Turns out this is completely unrelated to bug 3607. And it actually has nothing to do with opEquals, either! Change the test case from this: alias Foo!(2) Foo2; to this: alias Foo!(2u) Foo2; and it compiles!!! This is the same issue as bug 2257. *** This issue has been marked as a duplicate of issue 2257 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2257] Template value parameters behave like alias parameters
http://d.puremagic.com/issues/show_bug.cgi?id=2257 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #4 from Don clugd...@yahoo.com.au 2010-12-01 02:29:17 PST --- *** Issue 4289 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 2257] Template value parameters behave like alias parameters
http://d.puremagic.com/issues/show_bug.cgi?id=2257 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #5 from Don clugd...@yahoo.com.au 2010-12-01 02:29:56 PST --- Bug 2550 has the same root cause, I think. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2550] implicit conversions don't apply to template value parameter specialization
http://d.puremagic.com/issues/show_bug.cgi?id=2550 --- Comment #2 from Don clugd...@yahoo.com.au 2010-12-01 02:30:22 PST --- I believe bug 2257 is the same issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3607] Problems with struct opEquals and const
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Don clugd...@yahoo.com.au changed: What|Removed |Added Summary|Regression(2.037) Problems |Problems with struct |with struct opEquals and|opEquals and const |const | Severity|regression |enhancement --- Comment #2 from Don clugd...@yahoo.com.au 2010-12-01 03:12:08 PST --- The error message is correct, and the code compiles if you change the signature to ref const Foo. The spec clearly states: If structs declare an opEquals member function, it should follow the following form: struct S { int opEquals(ref const S s) { ... } } A key point in the forum discussion, which was missing from the bug report was this comment: I think it should be allowed to have a signature like this: bool opEquals(T other) const inside T as long as T can be implicitly cast from const to mutable. Changing to an enhancement request. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5294] New: loop optimization (-O) gone crazy
http://d.puremagic.com/issues/show_bug.cgi?id=5294 Summary: loop optimization (-O) gone crazy Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Severity: blocker Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: s...@extrawurst.org --- Comment #0 from Stephan Dilly s...@extrawurst.org 2010-12-01 03:30:24 PST --- void cpv(float x) {} void main(){ int cnt; for(int i=0; i30; i++) { cnt++; cpv(i*60 - 100); // comment this out and it makes 30 loops } writefln(%s,cnt); // compile with -O and it prints 1 } tested with dmd2.050 using -O for optimization. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5295] New: Template basename recognized as valid type inside template - shouldn't be.
http://d.puremagic.com/issues/show_bug.cgi?id=5295 Summary: Template basename recognized as valid type inside template - shouldn't be. Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: ah0801...@yahoo.com --- Comment #0 from Austin Hastings ah0801...@yahoo.com 2010-12-01 03:45:56 PST --- This code runs with dmd -run under 2.49. Note the array C[], which I don't think is valid. (If this IS considered valid, can someone explain the semantics to me?) == module scratch; class C(T) { C[] ary; void foo() { foreach( a; ary ) { a.bar(); } } void bar() { } } void main() { auto c = new C!int; c.foo(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5295] Template basename recognized as valid type inside template - shouldn't be.
http://d.puremagic.com/issues/show_bug.cgi?id=5295 Simen Kjaeraas simen.kja...@gmail.com changed: What|Removed |Added CC||simen.kja...@gmail.com --- Comment #1 from Simen Kjaeraas simen.kja...@gmail.com 2010-12-01 03:53:14 PST --- This seems not to be mentioned on http://digitalmars.com/d/2.0/template.html, but it is well-known and oft-used. The idea is that instead of having to type Foo!(int, bar, 42, MeaningOfLiff) everytime you want typeof(this), you can just use Foo. Foo!(int, bar, 42, MeaningOfLiff) still works, so nothing (as far as I can see) is lost. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5298] Template identifier in template scope short hand is undocumented.
http://d.puremagic.com/issues/show_bug.cgi?id=5298 Simen Kjaeraas simen.kja...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC||simen.kja...@gmail.com Resolution||DUPLICATE --- Comment #1 from Simen Kjaeraas simen.kja...@gmail.com 2010-12-01 05:37:26 PST --- *** This issue has been marked as a duplicate of issue 5295 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5302] New: Inline assembler: Indexing struct fields not possible inside member function
http://d.puremagic.com/issues/show_bug.cgi?id=5302 Summary: Inline assembler: Indexing struct fields not possible inside member function Product: D Version: unspecified Platform: Other OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: htven...@zonnet.nl --- Comment #0 from Harry Vennik htven...@zonnet.nl 2010-12-01 10:21:53 PST --- @ DMD 2.050 An instruction like: mov EAX, Struct.field[EDX]; compiles OK in free functions, but when inside a member function, the compiler complains about a wrong type of 'this' for type Struct. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3363] std.stream.readf segfaults with immutable format strings
http://d.puremagic.com/issues/show_bug.cgi?id=3363 Witold Baryluk bary...@smp.if.uj.edu.pl changed: What|Removed |Added Keywords||patch, rejects-valid CC||bary...@smp.if.uj.edu.pl --- Comment #1 from Witold Baryluk bary...@smp.if.uj.edu.pl 2010-12-01 11:38:23 PST --- Why this bug isn't fixed yet? It is trivial to fix and important, as many users (especially beginners) will encounter this problem. changing std/stream.d:694: if (arguments[j] is typeid(char[])) { into if (arguments[j] is typeid(string) || arguments[j] is typeid(char[])) { would fix it right? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5302] Inline assembler: Indexing struct fields not possible inside member function
http://d.puremagic.com/issues/show_bug.cgi?id=5302 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #1 from bearophile_h...@eml.cc 2010-12-01 12:29:54 PST --- Please, if possible add a complete minimal program that shows the problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5300] What type suffixes apply to with single argument template instances is undefined.
http://d.puremagic.com/issues/show_bug.cgi?id=5300 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #1 from bearophile_h...@eml.cc 2010-12-01 12:36:32 PST --- See also bug 5286 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5297] The lookup order of recursive with statements is undefined.
http://d.puremagic.com/issues/show_bug.cgi?id=5297 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #2 from bearophile_h...@eml.cc 2010-12-01 12:39:36 PST --- (In reply to comment #1) Symbols used in with should shadow symbols from other with statements. Do you mean shouldn't? This shadowing is not detected, and I think the compiler has to flag this is as a compile error (just like it does with normal variables in the function stack frame): struct X { int a; } struct Y { int a; } void main() { X x; Y y; with (x) { a = 2; with (y) { a = 1; } } assert(x.a == 2); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5294] -O optimization breaks for loop
http://d.puremagic.com/issues/show_bug.cgi?id=5294 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #1 from bearophile_h...@eml.cc 2010-12-01 12:47:01 PST --- Reduced a little: import core.stdc.stdio: printf; void foo(int) {} void main() { int count; for (int i = 0; i 2; i++) { count++; foo(i * 5 - 6); // comment this out and it makes 2 loops } printf(%d\n, count); // compile with -O and it prints 1 } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5303] New: (mtype.c) Compiler crash caused by pure
http://d.puremagic.com/issues/show_bug.cgi?id=5303 Summary: (mtype.c) Compiler crash caused by pure Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-12-01 12:51:04 PST --- struct Foo {} void bar(T)(Foo* f) pure if(true) {} void main() { bar!(int)(null); } DMD 2.050 shows: Assertion failure: 'tn-mod MODimmutable || tn-mod MODconst' on line 876 in file 'mtype.c' If I remove the pure the error vanishes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5304] New: Cannot access __dollar in pure function
http://d.puremagic.com/issues/show_bug.cgi?id=5304 Summary: Cannot access __dollar in pure function Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-12-01 12:52:21 PST --- pure void foo(T...)(T args) { auto x = args[1 .. $]; } void main() { foo(1, 2); } DMD 2.050 shows: test.d(2): Error: pure function 'foo' cannot access mutable static data '__dollar' test.d(5): Error: template instance test.foo!(int,int) error instantiating If I remove pure the error vanishes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5297] The lookup order of recursive with statements is undefined.
http://d.puremagic.com/issues/show_bug.cgi?id=5297 --- Comment #3 from Simen Kjaeraas simen.kja...@gmail.com 2010-12-01 14:59:32 PST --- (In reply to comment #2) (In reply to comment #1) Symbols used in with should shadow symbols from other with statements. Do you mean shouldn't? Yes and no. It shouldn't silently do so, but it should detect that that is what is happening, and cry out loudly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5294] -O optimization breaks for loop
http://d.puremagic.com/issues/show_bug.cgi?id=5294 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au Version|unspecified |D1 D2 --- Comment #2 from Don clugd...@yahoo.com.au 2010-12-01 16:26:06 PST --- Applies to all D1 and D2, even prehistoric versions (tested as far back as DMD0.140). Very weird. In bearophile's test case, written as for (int i = 0; i A; i++) { count++; foo(i * 5 - B); // comment this out and it makes 2 loops } it fails for B = (5+1)..(5*A) inclusive (eg, 6, 7, 8, 9, 10 all fail for A==2). And if it is foo(i*6 - B), it fails for B= 7..6*A. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5303] (mtype.c) Compiler crash caused by pure
http://d.puremagic.com/issues/show_bug.cgi?id=5303 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED CC||clugd...@yahoo.com.au Resolution||DUPLICATE --- Comment #1 from Don clugd...@yahoo.com.au 2010-12-01 16:33:51 PST --- Could be the most duplicated bug of all time. *** This issue has been marked as a duplicate of issue 4434 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4434] ICE(mtype.c, 887) alias with const, shared, or immutable
http://d.puremagic.com/issues/show_bug.cgi?id=4434 --- Comment #15 from Don clugd...@yahoo.com.au 2010-12-01 16:33:51 PST --- *** Issue 5303 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 5294] -O optimization breaks for loop
http://d.puremagic.com/issues/show_bug.cgi?id=5294 --- Comment #3 from Stephan Dilly s...@extrawurst.org 2010-12-01 16:49:47 PST --- i get the feeling #5100 is related to this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5305] New: intrinsic functions have @safe stripped of them in release mode.
http://d.puremagic.com/issues/show_bug.cgi?id=5305 Summary: intrinsic functions have @safe stripped of them in release mode. Product: D Version: unspecified Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: blood.of.l...@gmail.com --- Comment #0 from Bernard Helyer blood.of.l...@gmail.com 2010-12-01 16:50:30 PST --- https://gist.github.com/724508 The code snippet compiles with -release, but not without. In -release mode, the maths intrinsics have the mangling for @safe removed ('Nf'), and so the linker chokes on the mangled signature (because libphobos2.a was compiled with -release.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5294] -O optimization breaks for loop
http://d.puremagic.com/issues/show_bug.cgi?id=5294 --- Comment #4 from Stephan Dilly s...@extrawurst.org 2010-12-01 16:50:40 PST --- (In reply to comment #3) i get the feeling #5100 is related to this. for the lazy #5100 is http://d.puremagic.com/issues/show_bug.cgi?id=5100 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5100] -O Degrades performance of loop statements
http://d.puremagic.com/issues/show_bug.cgi?id=5100 --- Comment #2 from Stephan Dilly s...@extrawurst.org 2010-12-01 16:51:37 PST --- (In reply to comment #1) for the lazy #5100 is ooops very sorry this comment was meant to be for bug #5294 cause i think it is related. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5100] -O Degrades performance of loop statements
http://d.puremagic.com/issues/show_bug.cgi?id=5100 Stephan Dilly s...@extrawurst.org changed: What|Removed |Added CC||s...@extrawurst.org --- Comment #1 from Stephan Dilly s...@extrawurst.org 2010-12-01 16:50:43 PST --- for the lazy #5100 is -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5306] New: Disallow foreach ref on numeric interval
http://d.puremagic.com/issues/show_bug.cgi?id=5306 Summary: Disallow foreach ref on numeric interval Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: minor Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-12-01 18:24:54 PST --- This code compiles and runs with no errors with DMD 2.050, but I think this code is meaningless so it needs to be disallowed statically (items in the interval are not lvalues): void main() { foreach (ref i; 0 .. 10) { i++; } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4916] struct VariantN does not overload ()
http://d.puremagic.com/issues/show_bug.cgi?id=4916 Rob Jacques sandf...@jhu.edu changed: What|Removed |Added CC||sandf...@jhu.edu Depends on||4053 Severity|normal |enhancement -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5307] New: Using to!() should not allow removal of qualifiers
http://d.puremagic.com/issues/show_bug.cgi?id=5307 Summary: Using to!() should not allow removal of qualifiers Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: patch Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: jesse.k.phillip...@gmail.com CC: jesse.k.phillip...@gmail.com --- Comment #0 from Jesse Phillips jesse.k.phillip...@gmail.com 2010-12-01 22:06:55 PST --- Currently you can call 'to' on a const/immutable/shared object and have it converted to a mutable type. I think 'to' should provide safer conversions. In terms of pointers this is already true. The patch below does a few things. * Will not conflict with the implicitlyConverts version of to. * Objects can be cast to types of the same qualifier * Qualifiers can be changed based on the implicit rules ( immutable - const) * Casts are prevent for unsafe operations such as mutable - immutable See assertions for more details. Index: conv.d === --- conv.d(revision 2204) +++ conv.d(working copy) @@ -623,7 +623,13 @@ Object-to-object conversions throw exception when the source is non-null and the target is null. */ -T toImpl(T, S)(S value) if (is(S : Object) is(T : Object)) +T toImpl(T, S)(S value) if (is(S == class) is(T == class) + !implicitlyConverts!(S,T) +((is(Unqual!S == S) is(Unqual!T == T)) || +(is(S U == const U) is(T V == const V)) || +(is(S U == immutable U) (!is(Unqual!T == T))) || +(is(S U == shared U) !is(T V == const V) !is(Unqual!T == T)) || +(is(S U == shared(const U)) is(T V == shared(const V) { auto result = cast(T) value; if (!result value) @@ -643,6 +649,9 @@ A a1 = new A, a2 = new B, a3 = new C; assert(to!(B)(a2) is a2); assert(to!(C)(a3) is a3); +assert(__traits(compiles, to!(const A)(a1))); +assert(!__traits(compiles, to!(immutable A)(a1))); +assert(!__traits(compiles, to!(shared A)(a1))); try { to!(B)(a3); @@ -652,6 +661,18 @@ { //writeln(e); } + +const A a4 = new B; immutable A a5 = new B; shared A a6 = new B; +assert(!__traits(compiles, to!(B)(a4))); +assert(!__traits(compiles, to!(B)(a5))); +assert(!__traits(compiles, to!(B)(a6))); +assert(__traits(compiles, to!(const B)(a4))); +assert(__traits(compiles, to!(immutable B)(a5))); +assert(__traits(compiles, to!(shared B)(a6))); +assert(!__traits(compiles, to!(shared B)(a4))); +assert(__traits(compiles, to!(const B)(a5))); +assert(__traits(compiles, to!(immutable B)(a6))); +assert(__traits(compiles, to!(shared B)(a5))); } /** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5308] New: std.conv documentation is behind implementation
http://d.puremagic.com/issues/show_bug.cgi?id=5308 Summary: std.conv documentation is behind implementation Product: D Version: D2 Platform: Other URL: http://digitalmars.com/d/2.0/phobos/std_conv.html OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: websites AssignedTo: nob...@puremagic.com ReportedBy: jesse.k.phillip...@gmail.com CC: jesse.k.phillip...@gmail.com --- Comment #0 from Jesse Phillips jesse.k.phillip...@gmail.com 2010-12-01 22:12:02 PST --- The documentation on std.conv claims that to! will use a method called to in a class to make conversions. This has not been true for some time now. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5286] To avoid a problem with Template syntax
http://d.puremagic.com/issues/show_bug.cgi?id=5286 --- Comment #5 from Walter Bright bugzi...@digitalmars.com 2010-12-01 22:16:09 PST --- (In reply to comment #3) But I do. I know lots of people that have come to me with this problem, saying it made them almost not use D. I'd like more information on this, please. There's been nothing on the ng. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---