mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 21:51:03 +03:00
ImportC: can't access members in static array (#21185)
Fixes https://github.com/dlang/dmd/issues/20472 Arrays in C implicitly convert to a pointer to their first member, so do the implicit conversion when using them in an arrow member lookup.
This commit is contained in:
parent
7dd0506aaf
commit
ca2f90d1fc
3 changed files with 21 additions and 2 deletions
12
compiler/test/compilable/test20472.c
Normal file
12
compiler/test/compilable/test20472.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
// https://github.com/dlang/dmd/issues/20472
|
||||
typedef struct {
|
||||
char c;
|
||||
} stuff;
|
||||
|
||||
char test20472(void)
|
||||
{
|
||||
stuff s[1];
|
||||
s->c = 1;
|
||||
return s->c;
|
||||
}
|
||||
_Static_assert(test20472() == 1, "1");
|
Loading…
Add table
Add a link
Reference in a new issue