[Issue 3986] Struct constructors bypass default initialization of member variables

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3986


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

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2010-03-27 
00:34:11 PDT ---
changeset 421

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


[Issue 4013] New: Inconsistent codeview debug info for classes derived from IUnknown

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4013

   Summary: Inconsistent codeview debug info for classes derived
from IUnknown
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 01:14:34 
PDT ---
IUnknown and any class derived from it have inconsistent codeview debug info:

dmd -g -c lib

module lib;
interface IUnknown
{
void foo();
}

compiles to

$$TYPESsegment
00: LF_ARGLIST   argcount=0 
01: LF_VTSHAPE   count=1 05 
02: LF_CLASS count=1 typidx 1007 property=x dList  vshape
1001 length=x lib.IUnknown 
03: LF_CLASS count=0 typidx  property=x0080 dList  vshape
 length=x IUnknown 
04: LF_POINTER   x000a  typidx 1003 
...

and later referencing the incomplete type 1003. Please note that the class is
called lib.IUnknown in one entry, but IUnknown in the other.

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


[Issue 4013] Inconsistent codeview debug info for classes derived from IUnknown

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4013


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch, wrong-code


--- Comment #1 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 01:16:14 
PDT ---
This is caused by using sym-toPrettyChars() most of the time, but sometimes
not on cpp-interfaces. I think toPrettyChars() should always be used. Here's a
patch:

Index: toctype.c
===
--- toctype.c(revision 419)
+++ toctype.c(working copy)
@@ -381,8 +381,12 @@

 /* Need this symbol to do C++ name mangling
  */
-const char *name = sym-isCPPinterface() ? sym-ident-toChars()
-  : sym-toPrettyChars();
+const char *name = sym-toPrettyChars();
 s = symbol_calloc(name);
 s-Sclass = SCstruct;
 s-Sstruct = struct_calloc();

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


[Issue 4014] New: CodeView debug type info not linked in from library

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4014

   Summary: CodeView debug type info not linked in from library
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 01:33:12 
PDT ---
If a class is defined in a library, the debug info describing that class is not
linked into an executable, if it does not reference the init-property.

Example:

module lib;

struct struc_lib
{
int a, b;
}


dmd -g -lib lib

module test;
import lib;

void main()
{
struc_lib slib;
}

dmd -g test lib.lib


This produces incomplete debug info for struc_lib.

Using

struc_lib slib = struc_lib.init;

helps.

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


[Issue 2085] CTFE fails if the function is forward referenced

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2085


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #3 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 05:53:06 
PDT ---
Here's patch that invokes the semantic on the function if referenced.
Additioally, it needs to avoid duplicate semantic to be run later.

This patch also fixes #3499

Index: expression.c
===
--- expression.c(revision 421)
+++ expression.c(working copy)
@@ -2427,7 +2427,8 @@
 f = s-isFuncDeclaration();
 if (f)
 {//printf('%s' is a function\n, f-toChars());
-
+if (!f-originalType  f-scope) // semantic not yet run
+f-semantic(f-scope);
 if (!f-type-deco)
 {
 error(forward reference to %s, toChars());
Index: func.c
===
--- func.c(revision 421)
+++ func.c(working copy)
@@ -134,7 +134,7 @@
 parent = sc-parent;
 Dsymbol *parent = toParent();

-if (semanticRun == PASSsemanticdone)
+if (semanticRun = PASSsemanticdone) // BUG 2085
 {
 if (!parent-isClassDeclaration())
 return;

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


[Issue 4017] New: const initializer cannot evaluate size of forward referenced alias

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4017

   Summary: const initializer cannot evaluate size of forward
referenced alias
   Product: D
   Version: 2.041
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: patch, rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:00:38 
PDT ---
struct _A
{
   uint data;
}

const A_SIZE =   (A.sizeof);

alias _A A;

yields:
test.d(9): Error: size of type _A is not known

Here's the patch

Index: expression.c
===
--- expression.c(revision 421)
+++ expression.c(working copy)
@@ -6096,6 +6096,7 @@
 #endif
 else
 {
+e1 = e1-semantic(sc);
 e = e1-type-dotExp(sc, e1, ident);
 if (!(flag  e-op == TOKdotti))// let CallExp::semantic() handle
this
 e = e-semantic(sc);

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


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

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1266


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #7 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:05:49 
PDT ---
Here's a patch, but I am not 100% sure, whether the scope is correct for the
type aswell.

Index: expression.c
===
--- expression.c(revision 421)
+++ expression.c(working copy)
@@ -7432,6 +7432,7 @@
 error(can only * a pointer, not a '%s', e1-type-toChars());
 return new ErrorExp();
 }
+type = type-semantic(e1-loc, sc); // correct scope?
 rvalue();
 }
 return this;

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


[Issue 461] Constant not understood to be constant when circular module dependency exists.

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=461


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #2 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:11:09 
PDT ---
Semantics is not yet run on the SIZE identifier, so dmd does not know, it is
const. The patch invokes semantics if not yet run.

Index: optimize.c
===
--- optimize.c(revision 421)
+++ optimize.c(working copy)
@@ -47,6 +47,8 @@
 Expression *e = NULL;
 if (!v)
 return e;
+if (!v-originalType  v-scope) // semantic() not yet run - BUG 461
+v-semantic (v-scope);

 if (v-isConst() || v-isImmutable() || v-storage_class  STCmanifest)
 {

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


[Issue 2386] Array of forward referenced struct doesn't compile

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2386


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #1 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:17:13 
PDT ---
Here's a patch that simply invokes the semantics of the forward referenced
struct.

Index: struct.c
===
--- struct.c(revision 421)
+++ struct.c(working copy)
@@ -115,6 +115,8 @@
 //printf(AggregateDeclaration::size() = %d\n, structsize);
 if (!members)
 error(loc, unknown size);
+if (sizeok != 1  scope)
+semantic(NULL);
 if (sizeok != 1)
 {error(loc, no size yet for forward reference);
 //*(char*)0=0;


This patch also fixes #2654

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


[Issue 2654] Forward reference error with array of struct and circular import

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2654


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de


--- Comment #3 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:18:36 
PDT ---
Although the test case looks a bit different, the patch for #2386 also fixes
this issue

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


[Issue 945] template forward reference with named nested struct only

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=945


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #6 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:22:43 
PDT ---
Here's a patch that invokes the missing semantics. It also fixes issue #1055


Index: struct.c
===
--- struct.c(revision 421)
+++ struct.c(working copy)
@@ -178,6 +178,8 @@
 error(cannot have field %s with same struct type, v-toChars());
 }
 #endif
+if (ts-sym-sizeok != 1  ts-sym-scope)
+ts-sym-semantic(NULL);

 if (ts-sym-sizeok != 1)
 {

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


[Issue 1055] union forward reference overlapping initialization error

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1055


Rainer Schuetze r.sagita...@gmx.de changed:

   What|Removed |Added

   Keywords||patch
 CC||r.sagita...@gmx.de


--- Comment #5 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:26:03 
PDT ---
although #945 seems completely unrelated, the patch there also fixes this issue
including the dstress-tests.

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


[Issue 102] Forward reference nested class wheel.

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=102



--- Comment #13 from Rainer Schuetze r.sagita...@gmx.de 2010-03-27 06:29:36 
PDT ---
As much as I can see, all test cases in this report compile since dmd 1.054 and
dmd 2.038.

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


[Issue 102] Forward reference nested class wheel.

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=102


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #14 from Don clugd...@yahoo.com.au 2010-03-27 06:46:57 PDT ---
(In reply to comment #13)
 As much as I can see, all test cases in this report compile since dmd 1.054 
 and
 dmd 2.038.

Confirmed.

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


[Issue 3912] pure static nested functions are not recognized as pure

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3912


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

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #3 from Don clugd...@yahoo.com.au 2010-03-27 07:49:36 PDT ---
Fixed DMD2.042.

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


[Issue 3930] AAs horribly broken

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3930


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

   What|Removed |Added

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


--- Comment #4 from Don clugd...@yahoo.com.au 2010-03-27 07:50:20 PDT ---
Fixed DMD2.042.

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


[Issue 4018] New: Line Number not set at instatiation point

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4018

   Summary: Line Number not set at instatiation point
   Product: D
   Version: 2.041
  Platform: Other
   URL: http://digitalmars.com/d/2.0/template.html#TemplateVal
ueParameter
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
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-03-27 
09:30:37 PDT ---
The specification states that:

The __FILE__ and __LINE__ expand to the source file name and line number at the
point of instantiation.

This is not the case for the code below:

---
import std.stdio;

void ODSfd(alias n)() {
  writefln(%s:%s | %s = %d, __FILE__, __LINE__, n.stringof, n);
}
void ODSfs(alias n)() {
  writefln(%s:%s | %s = %s, __FILE__, __LINE__, n.stringof, n);
}
void ODSfx(alias n)() {
  writefln(%s:%s | %s = 0x%08x, __FILE__, __LINE__, n.stringof, n);
}

void main() {
   int zbar = 5;
   string foo = hi;

   ODSfd!(zbar);
   ODSfs!(foo);
   ODSfx!(zbar);
}
---

Expected output:
file.d:17 | zbar = 5
file.d:18 | foo = hi
file.d:19 | zbar = 0x0005


Actual output:
file.d:4 | zbar = 5
file.d:7 | foo = hi
file.d:10 | zbar = 0x0005

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


[Issue 4018] Line Number not set at instatiation point

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4018


Justin Spahr-Summers justin.spahrsumm...@gmail.com changed:

   What|Removed |Added

 CC||justin.spahrsumm...@gmail.c
   ||om


--- Comment #1 from Justin Spahr-Summers justin.spahrsumm...@gmail.com 
2010-03-27 11:44:50 CDT ---
(In reply to comment #0)


Note that the docs say that referring to template value parameters. The code
you posted is intended behavior; you would have to add a couple value
parameters to each one that default to __FILE__ and __LINE__ and print those
out.

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


[Issue 4018] Line Number not set at instatiation point

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4018


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

   What|Removed |Added

 OS/Version|Linux   |All


--- Comment #2 from Jesse Phillips jesse.k.phillip...@gmail.com 2010-03-27 
09:55:31 PDT ---
In that case, the below has the same result.


import std.stdio;

void ODSfd(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln(%s:%s | %s = %d, file, line, n.stringof, n);
}
void ODSfs(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln(%s:%s | %s = %s, file, line, n.stringof, n);
}
void ODSfx(alias n, string file = __FILE__, int line = __LINE__)() {
  writefln(%s:%s | %s = 0x%08x, file, line, n.stringof, n);
}

void main() {
   int zbar = 5;
   string foo = hi;

   ODSfd!(zbar);
   ODSfs!(foo);
   ODSfx!(zbar);
}
-

Expected Output:
linefile.d:17 | zbar = 5
linefile.d:18 | foo = hi
linefile.d:19 | zbar = 0x0005

Actual Output:
linefile.d:3 | zbar = 5
linefile.d:6 | foo = hi
linefile.d:9 | zbar = 0x0005

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


[Issue 2460] Ref functions can't be template functions.

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2460


Lars T. Kyllingstad bugzi...@kyllingen.net changed:

   What|Removed |Added

 CC||bugzi...@kyllingen.net
   Severity|minor   |major


--- Comment #1 from Lars T. Kyllingstad bugzi...@kyllingen.net 2010-03-27 
11:27:51 PDT ---
Raising importance, since operator overloading is now done with templated
functions, and this will become a major pain in the long run.

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


[Issue 3987] [gdb] Invalid DWARF output for function pointers

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3987



--- Comment #1 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:01:39 PDT ---
Compile with:
$ dmd -c -gc test.d
$ gcc test.o -o test -m32
(Note: I had a dmd.conf in the same directory to make sure druntime/phobos
weren't included, I don't know if this is needed)

void function() foobar;
extern(C)void _Dmodule_ref(){}
extern(C)int main(int argc, char** argv)
{
return 0;
}
//void foo(){}
//void main(){}

Uncommenting either of the 2 functions at the bottom will trigger the bug, but
without them it does not happen. I have attached 3 files, which are the outputs
of the following 3 commands:
$ objdump --dwarf test  dwarf2
$ objdump --dwarf test  dwarf # With void main(){}
$ diff -u dwarf2 dwarf
Hopefully this should help figure out what's happening. Without reading into
the DWARF spec I cannot figure out what's wrong, but there's not a huge amount
of difference between them, so it shouldn't take too much effort for someone
who knows the spec to figure out what's wrong. The above was tested with dmd
2.042.

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


[Issue 1188] Phobos doesn't correctly parse command-line arguments containing international characters

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #2 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:02:38 PDT ---
Created an attachment (id=590)
objdump --dwarf test  dwarf

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


[Issue 1188] Phobos doesn't correctly parse command-line arguments containing international characters

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #3 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:03:10 PDT ---
Created an attachment (id=591)
objdump --dwarf test  dwarf2

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


[Issue 1188] Phobos doesn't correctly parse command-line arguments containing international characters

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1188



--- Comment #4 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:07:00 PDT ---
Created an attachment (id=592)
diff -u dwarf2 dwarf

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


[Issue 1188] Phobos doesn't correctly parse command-line arguments containing international characters

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1188


Robert Clipsham rob...@octarineparrot.com changed:

   What|Removed |Added

 CC||rob...@octarineparrot.com


--- Comment #5 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:08:48 PDT ---
I have no idea why these patches were added to this issue, they were meant to
be added to bug #3987...

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


[Issue 3987] [gdb] Invalid DWARF output for function pointers

2010-03-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3987



--- Comment #2 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 
12:12:48 PDT ---
For some unknown reason (probably PEBKAC), the attachments were added to the
wrong ticket... See:
# objdump --dwarf test  dwarf
http://d.puremagic.com/issues/attachment.cgi?id=590
# objdump --dwarf test  dwarf2
http://d.puremagic.com/issues/attachment.cgi?id=591
# diff -u dwarf2 dwarf
http://d.puremagic.com/issues/attachment.cgi?id=592

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