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

          Issue ID: 22260
           Summary: importC: Error: struct `foo.Foo` no size because of
                    forward reference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

Given the following C code:

struct Foo* foo(void);

typedef struct Foo {
    int x;
} Foo;

foo.c(1): Error: struct `foo.Foo` no size because of forward reference

The compiler then segfaults.

Interestingly, changing it to 

struct Foo* foo(void);

struct Foo {
    int x;
} Foo;

Has the same behavior.

--

Reply via email to