www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24381] New: ImportC: .di generator emits both forward

https://issues.dlang.org/show_bug.cgi?id=24381

          Issue ID: 24381
           Summary: ImportC: .di generator emits both forward declarations
                    and definition
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dave287091 gmail.com

C code:
struct foo;
struct foo {
    int x;
};

struct bar {
    int x;
};
struct bar;

emitted .di file:
extern(C)
{
        // ...
        struct foo;
        struct foo
        {
                int x = void;
        }
        struct bar
        {
                int x = void;
        }
        struct bar;
        // ...
}

Which leads to an error about conflicting structs.

--
Feb 09