Bug 22106 – importC: Error: variable 'var' no definition of struct 'type'
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-06T09:16:12Z
Last change time
2021-07-07T06:23:09Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2021-07-06T09:16:12Z
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;
}
---
Comment #1 by dlang-bot — 2021-07-06T10:22:25Z
@ibuclaw created dlang/dmd pull request #12820 "fix Issue 22106 - importC: Error: variable 'var' no definition of struct 'type'" fixing this issue:
- fix Issue 22106 - importC: Error: variable 'var' no definition of struct 'type'
https://github.com/dlang/dmd/pull/12820
Comment #2 by dlang-bot — 2021-07-07T06:23:09Z
dlang/dmd pull request #12820 "fix Issue 22106 - importC: Error: variable 'var' no definition of struct 'type'" was merged into master:
- 1c81e07faff6aea0b363b088bd419dd3cbc56c36 by Iain Buclaw:
fix Issue 22106 - importC: Error: variable 'var' no definition of struct 'type'
https://github.com/dlang/dmd/pull/12820