Skip to content

Commit 580ff68

Browse files
authored
Merge pull request ldc-developers#4749 from kinke/merge_stable
Merge upstream stable
2 parents d562736 + 9ce0aab commit 580ff68

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
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)
4+
- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707, #4737, #4749)
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/dtemplate.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,9 @@ MATCH deduceType(RootObject o, Scope* sc, Type tparam, ref TemplateParameters pa
17141714
edim = s ? getValue(s) : getValue(e);
17151715
}
17161716
}
1717-
if (tp && tp.matchArg(sc, t.dim, i, &parameters, dedtypes, null) || edim && edim.toInteger() == t.dim.toInteger())
1717+
if ((tp && tp.matchArg(sc, t.dim, i, &parameters, dedtypes, null)) ||
1718+
(edim && edim.isIntegerExp() && edim.toInteger() == t.dim.toInteger())
1719+
)
17181720
{
17191721
result = deduceType(t.next, sc, tparam.nextOf(), parameters, dedtypes, wm);
17201722
return;

dmd/expression.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ extern (C++) /* IN_LLVM abstract */ class Expression : ASTNode
475475
dinteger_t toInteger()
476476
{
477477
//printf("Expression %s\n", EXPtoString(op).ptr);
478-
if (!type.isTypeError())
478+
if (!type || !type.isTypeError())
479479
error(loc, "integer constant expression expected instead of `%s`", toChars());
480480
return 0;
481481
}

tests/dmd/runnable/ifti.d

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ class Tst(TST, int v = 2) {
7272

7373
class Y : Tst!(float) {}
7474

75+
// https://issues.dlang.org/show_bug.cgi?id=24731
76+
void test24731()
77+
{
78+
static int solve(size_t N)(ref double[N+1][N])
79+
{
80+
return N;
81+
}
82+
83+
double[3][2] m;
84+
assert(solve(m) == 2);
85+
assert(solve!2(m) == 2);
86+
}
87+
88+
7589
void main() {
7690
Tst!(int) t = new Tst!(int);
7791
Y u = new Y;
@@ -113,4 +127,5 @@ void main() {
113127
printf("%g\n", i);
114128
}
115129

130+
test24731();
116131
}

0 commit comments

Comments
 (0)