]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/gdc.test/runnable/testOpApply.d
d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / testOpApply.d
index 7b884e5857cde1767f6bf7167dfc2725582e1ea6..285365eea82e36b53254a724e6a9a63f49dccbd3 100644 (file)
@@ -1,4 +1,4 @@
-/* PERMUTE_ARGS:
+/* PERMUTE_ARGS: -preview=dip1000
  */
 
 // https://issues.dlang.org/show_bug.cgi?id=15624
@@ -140,3 +140,32 @@ void testInverseAttributes()
     }
     safe();
 }
+
+// https://issues.dlang.org/show_bug.cgi?id=20907
+Lockstep!() lockstep()
+{
+    return Lockstep!()();
+}
+
+struct Lockstep()
+{
+    int opApply(int delegate(int) callback) @system
+    {
+        return 0;
+    }
+
+    int opApply(int delegate(int) pure nothrow @nogc @safe callback) pure nothrow @nogc @safe
+    {
+        return 0;
+    }
+}
+
+void foo0()
+{
+    foreach (x; lockstep()) {}
+}
+
+void foo1()
+{
+    foreach (x; lockstep()) {}
+}