From 50da4f92adc7f02e457abb49324db9af2db813a2 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Mon, 18 Oct 2021 01:36:39 +0200 Subject: [PATCH] fix Issue 22399 - importC: Error: static variable cannot be read at compile time --- test/compilable/testcstuff2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/compilable/testcstuff2.c b/test/compilable/testcstuff2.c index c62d762d22a8..d0b6d84ad370 100644 --- a/test/compilable/testcstuff2.c +++ b/test/compilable/testcstuff2.c @@ -458,6 +458,22 @@ static const S22375 s22375[10] = {32, 258, 258, 4096} }; +/***************************************************/ +// https://issues.dlang.org/show_bug.cgi?id=22399 + +struct S22399a +{ + unsigned short f1; +}; + +struct S22399b +{ + const struct S22399a *f1; +}; + +const struct S22399a C22399[1] = { {12} }; +const struct S22399b C22399b = {C22399}; + /***************************************************/ // https://issues.dlang.org/show_bug.cgi?id=22400