[Issue 22106] New: importC: Error: variable 'var' no definition of struct 'type'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 6 09:16:12 UTC 2021


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

          Issue ID: 22106
           Summary: importC: Error: variable 'var' no definition of struct
                    'type'
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

Occurs when a struct is defined as `typedef struct type`, then later used to
declare a variable with `struct type` instead of its typedef'd name.
---
typedef struct S
{
  int field;
} S_t;

struct T
{
  struct S f1;   // NG -> errors !!!
  S_t f2;        // OK -> compiles
  struct S_t f3; // OK -> errors
};

int main()
{
  struct S var;   // NG -> errors !!!
  return 0;
}
---

--


More information about the Digitalmars-d-bugs mailing list