Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1457 from 9rnsr/fix9259

Issue 9259 - Passing an array of pointers to a typesafe vararg is broken
  • Loading branch information...
commit 5c00c8dae6dbc0e78a91e6d67229557b4726c9c3 2 parents 0d49324 + 066b280
@WalterBright WalterBright authored
Showing with 14 additions and 1 deletion.
  1. +1 −1  src/mtype.c
  2. +13 −0 test/runnable/test9259.d
View
2  src/mtype.c
@@ -4337,7 +4337,7 @@ MATCH TypeDArray::implicitConvTo(Type *to)
return MATCHconvert;
}
- return next->constConv(to);
+ return next->constConv(to) ? MATCHconvert : MATCHnomatch;
}
if (to->ty == Tarray)
View
13 test/runnable/test9259.d
@@ -0,0 +1,13 @@
+// PERMUTE_ARGS: -inline -release -g -O -d -dw -de
+
+void test(int*[] arr...)
+{
+ assert(arr.length == 1);
+ assert(*arr[0] == 5); // This assertion fails
+}
+
+void main()
+{
+ int a = 5;
+ test([&a]);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.