summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/runnable/test16047.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/runnable/test16047.d')
-rw-r--r--gcc/testsuite/gdc.test/runnable/test16047.d17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/runnable/test16047.d b/gcc/testsuite/gdc.test/runnable/test16047.d
new file mode 100644
index 00000000000..eff2db3c7c4
--- /dev/null
+++ b/gcc/testsuite/gdc.test/runnable/test16047.d
@@ -0,0 +1,17 @@
+// https://issues.dlang.org/show_bug.cgi?id=16047
+module test16047;
+
+void main()
+{
+ Reassignable[int][int] aa;
+
+ aa[0][0] = Reassignable.init;
+ aa[s()][0] = Reassignable.init; // range violation
+}
+
+struct Reassignable
+{
+ void opAssign(Reassignable) {}
+}
+
+int s() { return 1; }