[Issue 24199] New: ImportC: generated .di file uses `struct` keyword when referring to a type.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 25 05:44:26 UTC 2023


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

          Issue ID: 24199
           Summary: ImportC: generated .di file uses `struct` keyword when
                    referring to a type.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dave287091 at gmail.com

// s.c
struct Foo {
    int x;
};

struct Foo foo(void);

when processed into a .di file:

// s.di
// D import file generated from 's.c'
extern (C)
{
        struct Foo
        {
                int x = void;
        }
        struct Foo foo(); // this is not valid D, remove the `struct`
}

--


More information about the Digitalmars-d-bugs mailing list