fix Issue 24155 - ImportC: accept C23 default initializers (#15801)

This commit is contained in:
Walter Bright 2023-11-15 13:04:42 -08:00 committed by GitHub
parent 00a2a7f180
commit 8c84af86bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 136 additions and 5 deletions

View file

@ -844,6 +844,30 @@ void test24154()
/*******************************************/
// https://issues.dlang.org/show_bug.cgi?id=24155
struct S24155 { int x, y; };
struct S24155 s = { };
void abc(int i)
{
assert(s.x == 0 && s.y == 0, __LINE__);
struct S24155 s1 = { };
assert(s1.x == 0 && s1.y == 0, __LINE__);
struct S24155 s2 = { { i }, { } };
assert(s2.x == i && s2.y == 0, __LINE__);
struct S24155 s3 = { { }, { i } };
assert(s3.x == 0 && s3.y == i, __LINE__);
}
void test24155()
{
abc(1);
}
/*******************************************/
int main()
{
test1();
@ -893,6 +917,7 @@ int main()
test22925();
test47();
test24154();
test24155();
return 0;
}