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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 27 06:17:15 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=2386


Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |r.sagitario at gmx.de


--- Comment #1 from Rainer Schuetze <r.sagitario at 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: -------


More information about the Digitalmars-d-bugs mailing list