www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24374] New: ImportC: .di generator incorrect output for

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

          Issue ID: 24374
           Summary: ImportC: .di generator incorrect output for anonymous
                    structs as members
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Keywords: ImportC
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dave287091 gmail.com

C file:

union foo {
    struct { int x; } X;
};

struct bar {
    struct { int x; } X;
};


Results in following in .di file:

extern(C)
{
  // ...
        union foo
        {
                struct  X = void;
        }
        struct bar
        {
                struct  X = void;
        }
  // ...
}

Which is not valid D code.

--
Feb 08