summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/test23170.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/test23170.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/test23170.d12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test23170.d b/gcc/testsuite/gdc.test/fail_compilation/test23170.d
new file mode 100644
index 00000000000..eb79cd81565
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/test23170.d
@@ -0,0 +1,12 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test23170.d(10): Error: array literal in `@nogc` delegate `test23170.__lambda5` may cause a GC allocation
+---
+*/
+// https://issues.dlang.org/show_bug.cgi?id=23170
+
+@nogc:
+enum lambda = () => badAlias([1, 2, 3]);
+alias badAlias = (int[] array) => id(array);
+int[] id(int[] array) { return array; }