www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14954] New: extern opaque struct instance doesn't compile


          Issue ID: 14954
           Summary: extern opaque struct instance doesn't compile
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

Let's say I have some C headers that have code like this in:

extern struct UndeclaredStruct blah;
UndeclaredStruct *p = &blah;

which would naïvely translate to D as:

struct UndeclaredStruct;
extern(C) __gshared extern UndeclaredStruct blah;
__gshared auto p = &blah;

which doesn't compile:
Error: variable opaque.blah no definition of struct UndeclaredStruct

Aug 24 2015