www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10793] New: Forward reference errors casting from void* to opaque struct pointer

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793

           Summary: Forward reference errors casting from void* to opaque
                    struct pointer
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: aldacron gmail.com



module forrref;

struct RealFoo {
    int i;
}

struct foo;

void main() {
    auto rf = RealFoo( 10 );
    void* prf = cast( void* )rf;
    foo* f = cast( foo* )prf;
}

forref.d(7): Error: struct forrref.foo unknown size
forref.d(7): Error: struct forrref.foo no size yet for forward reference
forref.d(7): Error: struct forrref.foo unknown size
forref.d(7): Error: struct forrref.foo no size yet for forward reference

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



08:27:30 PDT ---
Similar or dupe of Issue 10497.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |henning still-hidden.de



PDT ---
I cannot reproduce either this or 10497 using git head.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793




11:35:34 PDT ---

 I cannot reproduce either this or 10497 using git head.
I can reproduce this test-case in git-head (b55f805133f9d249890ddf6b98270ca826b3e26b) but with only one error now: test.d(11): Error: e2ir: cannot cast rf of type RealFoo to type void* I can fully reproduce both issues with 2.063. However I can no longer reproduce Issue 10497 in git-head. I suggest we add a test-case for 10497 before that bug is reintroduced. As for this Issue 10793, could you test it with git-head again? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793




PDT ---
He just missed a 'new' before RealFoo, I guess.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793




22:57:49 PDT ---

 He just missed a 'new' before RealFoo, I guess.
Ah my bad, yes. Do you want to add these test-cases or should I? Let's not let them creep in again. :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 11 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793





 He just missed a 'new' before RealFoo, I guess.
Actually, I missed an '&'! void* prf = cast( void* )rf; But new works, too! Given that this works with git head, I wonder about bug 10451. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 12 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



PDT ---
https://github.com/D-Programming-Language/dmd/pull/2466

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 12 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/e4ba50055c42f4b0dc67369dfcffd8a1526c7821
add test cases for issues 10497 and 10793

https://github.com/D-Programming-Language/dmd/commit/7a3dd014165c3710ffc4ed9f375d962be7516152


add test cases for issues 10497 and 10793

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 17 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10793


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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