summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/pr9383.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/pr9383.d')
-rw-r--r--gcc/testsuite/gdc.test/compilable/pr9383.d25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/pr9383.d b/gcc/testsuite/gdc.test/compilable/pr9383.d
new file mode 100644
index 00000000000..ca6d70fa2e6
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/pr9383.d
@@ -0,0 +1,25 @@
+// REQUIRED_ARGS: -preview=dip1000
+// https://github.com/dlang/dmd/pull/9383
+
+void test() @safe
+{
+ int[1] a = [1];
+ cartesianProduct(a[]);
+}
+
+auto cartesianProduct(RR...)(RR ranges)
+{
+ static struct Result
+ {
+ RR current;
+
+ void popFront() scope @safe
+ {
+ foreach (ref r; current)
+ {
+ }
+ }
+ }
+
+ return Result(ranges);
+}