mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
fix Issue 23030 - importC: errors using typedef struct after first use as const
This commit is contained in:
parent
05cba824a0
commit
bcfce20b8d
1 changed files with 15 additions and 0 deletions
15
compiler/test/compilable/test23030.c
Normal file
15
compiler/test/compilable/test23030.c
Normal 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`
|
Loading…
Add table
Add a link
Reference in a new issue