Skip to content

Commit 65b882d

Browse files
authored
Merge pull request #4768 from kinke/merge_stable
Merge upstream stable
2 parents 495578b + aab2713 commit 65b882d

File tree

18 files changed

+163
-12
lines changed

18 files changed

+163
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LDC master
22

33
#### Big news
4-
- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707, #4737, #4749)
4+
- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707, #4737, #4749, #4768)
55
- LLVM for prebuilt packages bumped to v18.1.8 (incl. macOS arm64). (#4712)
66
- Android: NDK for prebuilt package bumped from r26d to r27. (#4711)
77
- ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717)

dmd/dcast.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2336,7 +2336,7 @@ Expression castTo(Expression e, Scope* sc, Type t, Type att = null)
23362336
Type tb = t.toBasetype();
23372337
Type typeb = e.type.toBasetype();
23382338

2339-
if (e.hexString && !e.committed)
2339+
if (e.hexString && !e.committed && tb.nextOf().isintegral)
23402340
{
23412341
const szx = cast(ubyte) tb.nextOf().size();
23422342
if (szx != se.sz && (e.len % szx) == 0)

dmd/dinterpret.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6136,7 +6136,7 @@ public:
61366136
{
61376137
auto se = e1.isStringExp();
61386138
// Allow casting a hex string literal to short[], int[] or long[]
6139-
if (se && se.hexString && se.postfix == StringExp.NoPostfix)
6139+
if (se && se.hexString && se.postfix == StringExp.NoPostfix && e.to.nextOf().isintegral)
61406140
{
61416141
const sz = cast(size_t) e.to.nextOf().size;
61426142
if ((se.len % sz) != 0)

dmd/enumsem.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void enumSemantic(Scope* sc, EnumDeclaration ed)
186186

187187
if (ed.members.length == 0)
188188
{
189-
.error(ed.loc, "%s `%s enum `%s` must have at least one member", ed.kind, ed.toPrettyChars, ed.toChars());
189+
.error(ed.loc, "%s `%s` enum `%s` must have at least one member", ed.kind, ed.toPrettyChars, ed.toChars());
190190
ed.errors = true;
191191
ed.semanticRun = PASS.semanticdone;
192192
return;

dmd/hdrgen.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,10 +1726,10 @@ void toCBuffer(Dsymbol s, ref OutBuffer buf, ref HdrGenState hgs)
17261726
//printf("FuncDeclaration::toCBuffer() '%s'\n", f.toChars());
17271727
if (stcToBuffer(buf, f.storage_class))
17281728
buf.writeByte(' ');
1729+
typeToBuffer(f.type, f.ident, buf, hgs);
17291730
auto tf = f.type.isTypeFunction();
1730-
typeToBuffer(tf, f.ident, buf, hgs);
17311731

1732-
if (hgs.hdrgen)
1732+
if (hgs.hdrgen && tf)
17331733
{
17341734
// if the return type is missing (e.g. ref functions or auto)
17351735
// https://issues.dlang.org/show_bug.cgi?id=20090
@@ -1864,9 +1864,9 @@ void toCBuffer(Dsymbol s, ref OutBuffer buf, ref HdrGenState hgs)
18641864
if (stcToBuffer(buf, d.storage_class))
18651865
buf.writeByte(' ');
18661866
buf.writestring("invariant");
1867-
if(auto es = d.fbody.isExpStatement())
1867+
auto es = d.fbody.isExpStatement();
1868+
if (es && es.exp && es.exp.op == EXP.assert_)
18681869
{
1869-
assert(es.exp && es.exp.op == EXP.assert_);
18701870
buf.writestring(" (");
18711871
(cast(AssertExp)es.exp).e1.expressionToBuffer(buf, hgs);
18721872
buf.writestring(");");

dmd/parse.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9749,6 +9749,7 @@ immutable PREC[EXP.max + 1] precedence =
97499749
EXP.assign : PREC.assign,
97509750
EXP.construct : PREC.assign,
97519751
EXP.blit : PREC.assign,
9752+
EXP.loweredAssignExp : PREC.assign,
97529753
EXP.addAssign : PREC.assign,
97539754
EXP.minAssign : PREC.assign,
97549755
EXP.concatenateAssign : PREC.assign,

dmd/typesem.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,9 @@ extern (D) MATCH callMatch(TypeFunction tf, Type tthis, ArgumentList argumentLis
835835
L1:
836836
if (parameterList.varargs == VarArg.typesafe && u + 1 == nparams) // if last varargs param
837837
{
838-
auto trailingArgs = args[u .. $];
838+
Expression[] trailingArgs;
839+
if (args.length >= u)
840+
trailingArgs = args[u .. $];
839841
if (auto vmatch = matchTypeSafeVarArgs(tf, p, trailingArgs, pMessage))
840842
return vmatch < match ? vmatch : match;
841843
// Error message was already generated in `matchTypeSafeVarArgs`

runtime/druntime/src/importc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#define __alignof _Alignof
4242
#define __vector_size__ vector_size
4343
#define __typeof typeof
44+
#define __typeof__ typeof
4445

4546
/********************
4647
* Clang nullability extension used by macOS headers.

tests/dmd/compilable/extra-files/vcg-ast.d.cg

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ void main()
100100
values();
101101
return 0;
102102
}
103+
import imports.vcg_ast_import;
104+
template imported()
105+
{
106+
import imported = imports.vcg_ast_import;
107+
}
108+
alias myImport = vcg_ast_import;
103109
R!int
104110
{
105111
struct _R
@@ -137,6 +143,21 @@ mixin _d_cmain!();
137143
}
138144
}
139145
}
146+
imported!()
147+
{
148+
import object;
149+
struct O
150+
{
151+
invariant
152+
{
153+
}
154+
invariant
155+
{
156+
__invariant0();
157+
}
158+
}
159+
160+
}
140161
RTInfo!(C)
141162
{
142163
enum immutable(void)* RTInfo = null;
@@ -161,4 +182,3 @@ RTInfo!(_R)
161182
enum immutable(void)* RTInfo = null;
162183

163184
}
164-

0 commit comments

Comments
 (0)