[Issue 2199] Segfault using array operation in function call

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2199





--- Comment #4 from clugd...@yahoo.com.au  2009-04-18 01:04 ---
Fixed DMD2.028. Not yet fixed in D1.


-- 



[Issue 2203] typeof(class.template.foo) crashes compiler

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2203





--- Comment #3 from clugd...@yahoo.com.au  2009-04-18 01:05 ---
Fixed DMD2.028, not yet fixed in D1.


-- 



[Issue 2577] DMD crashes on foreach of undefined identifier

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2577


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #4 from clugd...@yahoo.com.au  2009-04-18 01:07 ---
Fixed DMD2.028


-- 



[Issue 1884] manifest constants for strings

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1884


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #6 from clugd...@yahoo.com.au  2009-04-18 01:36 ---
Neil's bug is actually totally different, and not related to strings in any
way.-- Bug #2850.
The original bug is fixed.


-- 



[Issue 2850] New: bad codegen for struct static initializers

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2850

   Summary: bad codegen for struct static initializers
   Product: D
   Version: 2.012
  Platform: PC
OS/Version: Windows
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: clugd...@yahoo.com.au


This assert fails at runtime. The initialization doesn't happen.
Struct literals work. Also enum Test test = { 714 };  works.

-
struct Test{
 int foo;
}

enum Test test = { foo:714 };

void main(){
assert(test.foo == 714);
}


-- 



[Issue 1702] ICE when identifier is undefined

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1702


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

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED




-- 



[Issue 1787] Compiler segfaults on circular references.

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1787


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

   What|Removed |Added

   Keywords||patch
 OS/Version|Linux   |All




--- Comment #2 from clugd...@yahoo.com.au  2009-04-18 02:47 ---
(In reply to comment #1)
 Related to issue 713?
 
 WFM 1.035 Windows.  Has it gone away, or is it platform parity?
 
The first example now works, but the second one segfaults:
struct C {
  const x = C.x;
}
Segfaults on DMD2.028 and 1.042 Windows.

I've patched it so that it displays:
bug.d(2): Error: variable bug.C.x cannot infer type

Patch against DMD2.028 in void VarDeclaration::semantic(Scope *sc).

Index: declaration.c
===
--- declaration.c   (revision 22)
+++ declaration.c   (working copy)
@@ -688,6 +688,7 @@
 if (!type)
 {  inuse++;
type = init-inferType(sc);
+   if (!type) { error(cannot infer type); return; } 
inuse--;
inferred = 1;


-- 



[Issue 2346] ICE when comparing typedef'd class

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2346





--- Comment #2 from clugd...@yahoo.com.au  2009-04-18 03:53 ---
The code should be accepted, but at least it's easy enough to convert the
segfault into an error with line number:

e2ir.c line 3612.

cdfrom = e1-type-isClassHandle();
+   if (!cdfrom){ error(ICE: Bugzilla 2346);  return e;}
cdto   = t-isClassHandle();
if (cdfrom-isInterfaceDeclaration()) //-- it is segfaulting here
{


-- 



[Issue 2852] New: Cannot pass temporary result by reference (regression)

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2852

   Summary: Cannot pass temporary result by reference (regression)
   Product: D
   Version: 2.026
  Platform: PC
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: 2kor...@gmail.com


Test code:

struct Rect
{
int x,y,w,h;
}

void pass(ref Rect rect)
{
}

Rect get()
{
return Rect();
}

void main()
{
pass(get);
}

Note that this is a regression since DMD2.025


-- 



[Issue 2852] Cannot pass temporary result by reference (regression)

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2852





--- Comment #1 from 2kor...@gmail.com  2009-04-18 07:25 ---
Compiler output (dmd2.028):
test.d(17): Error: function test.pass (ref Rect rect) does not match parameter
types (Rect)
test.d(17): Error: get() is not an lvalue


-- 



[Issue 2816] Sudden-death static assert is not very useful

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2816





--- Comment #11 from clugd...@yahoo.com.au  2009-04-18 17:13 ---
Found another bug in this patch.  Should start the count from 0, not 1.
Otherwise you can get a segfault when the out-by-1 error shows up in the only
show first and last iterations case.

in TemplateInstance::printInstantiationTrace()

// determine instantiation depth and number of recursive instantiations
int n_instantiations = 0;


-- 



[Issue 1138] ICE when tuple template gets indexed

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1138


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #2 from clugd...@yahoo.com.au  2009-04-18 17:38 ---
Works for me on Windows 2.028 and 1.042. Also shown to work in the LDC dstress
results for 1.043.


-- 




[Issue 1266] Cannot forward reference the typeof of the base type of a pointer whose base type is defined with typeof

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1266





--- Comment #4 from clugd...@yahoo.com.au  2009-04-18 17:45 ---
This seems to be fixed on DMD2.028 (although possibly because of some other
patch I've made g -- that would indicate that it's a duplicate). Still
segfaults on D1.042.


-- 



[Issue 2853] New: Property overriding problem

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2853

   Summary: Property overriding problem
   Product: D
   Version: 1.043
  Platform: PC
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: d294...@bsnow.net


class Base
{
int number() { return _number; } // getter
int number(int value) { return _number; } // setter

private:
int _number;
}

class Extension: Base
{   
override int number(int value)  // override setter
{
return 0; 
}

void method()
{
printNumber(this.number); // call base getter

// main.d(21): Error: function main.Extension.number (int) does
not match parameter types ()
// main.d(21): Error: expected 1 arguments, not 0
}
}

Tries call overrided setter


-- 



[Issue 2853] Property overriding problem

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2853





--- Comment #1 from 2kor...@gmail.com  2009-04-18 19:23 ---
Fake properties must die, all I can say.


-- 



[Issue 2855] New: __traits: no way to get overloads and information for non-instance methods

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2855

   Summary: __traits: no way to get overloads and information for
non-instance methods
   Product: D
   Version: 2.027
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: dhase...@gmail.com


Given a UDT and a constructor or a static method, I want to use __traits to
access overloads of that constructor or static method.

__traits provides allMembers, which returns static and non-static functions and
non-static constructors. It also provides getVirtualFunctions, which provides
overloads for non-static functions. There is no equivalent to
getVirtualFunctions for constructors or static functions.


-- 



[Issue 2856] New: static opIndex does not compile for a templated struct/class

2009-04-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2856

   Summary: static opIndex does not compile for a templated
struct/class
   Product: D
   Version: 2.027
  Platform: PC
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P3
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: sandf...@jhu.edu


Static opIndex functions result in compile time errors for templated structs
and classes. Using a typedef, fixes the issue. static opCall and generic static
functions don't appear to be affected.
Test case:
import std.stdio;

struct foo{ static void opIndex(int i) { writefln(foo); } }
struct bar(T) { static void opIndex(int i) { writefln(bar); } }

int main(char[][] args) {

foo[1];
//bar!(float)[1];  // Error (# = __LINE__)
typedef bar!(float) B; 
B[1];  // Okay

return 0;
}
main.d:#: Error: struct bar must be an array or pointer type, not void
main.d:#: Error: [i] has no effect in expression (struct bar[1])


--