dmd/compiler/test/compilable/test20472.c
drpriver ca2f90d1fc
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.
2025-04-09 17:58:14 +08:00

12 lines
195 B
C

// 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");