fix Issue 23030 - importC: errors using typedef struct after first use as const

This commit is contained in:
Walter Bright 2022-09-03 23:32:25 -07:00 committed by The Dlang Bot
parent 05cba824a0
commit bcfce20b8d

View file

@ -0,0 +1,15 @@
// https://issues.dlang.org/show_bug.cgi?id=23030
typedef struct {
int i;
} S1;
const S1 unused;
S1 s;
void fn() { int i = s.i; } // Error: need `this` for `i` of type `int`
typedef struct {
int a,b;
} S2;
const S2 aaa = { 0,0 };
S2 bbb = { 0,0 }; // Error: 1 extra initializer(s) for `struct __tag3`