summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail18994.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail18994.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail18994.d20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail18994.d b/gcc/testsuite/gdc.test/fail_compilation/fail18994.d
new file mode 100644
index 00000000000..14935a72671
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail18994.d
@@ -0,0 +1,20 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail18994.d(19): Error: struct `fail18994.Type1` is not copyable because it has a disabled postblit
+---
+*/
+struct Type2
+{
+ int opApply(int delegate(ref Type1)) { return 0; }
+}
+
+struct Type1
+{
+ @disable this(this);
+}
+
+void test()
+{
+ foreach(b; Type2()) {}
+}