summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail22202.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail22202.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail22202.d22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22202.d b/gcc/testsuite/gdc.test/fail_compilation/fail22202.d
new file mode 100644
index 00000000000..167d3624879
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail22202.d
@@ -0,0 +1,22 @@
+// https://issues.dlang.org/show_bug.cgi?id=22202
+
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail22202.d(21): Error: function `fail22202.fun(SystemCopy _param_0)` is not callable using argument types `(SystemCopy)`
+fail_compilation/fail22202.d(21): `inout ref inout(SystemCopy)(ref inout(SystemCopy) other)` copy constructor cannot be called from a `pure @safe nogc` context
+---
+*/
+
+struct SystemCopy
+{
+ this(ref inout SystemCopy other) inout {}
+}
+
+void fun(SystemCopy) @safe pure @nogc {}
+
+void main() @safe pure @nogc
+{
+ SystemCopy s;
+ fun(s);
+}