Skip to content

Commit fcec763

Browse files
committed
Merge remote-tracking branch 'origin/dmd-rewrite-stable' into merge_stable
2 parents a312cb5 + 9cf3a26 commit fcec763

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

dmd/expressionsem.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6984,10 +6984,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
69846984
while (1)
69856985
{
69866986
AttribDeclaration ad = s.isAttribDeclaration();
6987-
if (!ad)
6988-
break;
6989-
if (ad.decl && ad.decl.length == 1)
6987+
if (ad && ad.decl && ad.decl.length == 1)
69906988
s = (*ad.decl)[0];
6989+
else
6990+
break;
69916991
}
69926992

69936993
//printf("inserting '%s' %p into sc = %p\n", s.toChars(), s, sc);

runtime/druntime/src/core/stdc/stdarg.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ else version (LDC)
317317
}
318318
else version (DigitalMars)
319319
{
320-
void va_end(va_list ap) {}
320+
void va_end()(va_list ap) {}
321321
}
322322

323323

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
TEST_OUTPUT:
3+
---
4+
fail_compilation/test21247.d(13): Error: anonymous union can only be a part of an aggregate, not function `hang_dmd`
5+
fail_compilation/test21247.d(17): Error: undefined identifier `u`
6+
fail_compilation/test21247.d(18): Error: undefined identifier `b`
7+
fail_compilation/test21247.d(20): called from here: `hang_dmd(0u)`
8+
---
9+
*/
10+
// https://github.com/dlang/dmd/issues/21247
11+
ubyte[4] hang_dmd(uint a)
12+
{
13+
union {
14+
uint u = void;
15+
ubyte[4] b;
16+
}
17+
u = a;
18+
return b;
19+
}
20+
enum T = hang_dmd(0);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
TEST_OUTPUT:
3+
---
4+
fail_compilation/test21247b.d(10): Error: anonymous union can only be a part of an aggregate, not function `test21247`
5+
---
6+
*/
7+
// https://github.com/dlang/dmd/issues/21247
8+
void test21247()
9+
{
10+
union {
11+
uint u = void;
12+
ubyte[4] b;
13+
}
14+
}

0 commit comments

Comments
 (0)