mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
fix Issue 24155 - ImportC: accept C23 default initializers (#15801)
This commit is contained in:
parent
00a2a7f180
commit
8c84af86bc
13 changed files with 136 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue