summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail20658.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail20658.d14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20658.d b/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
new file mode 100644
index 00000000000..fd422aaa168
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail20658.d
@@ -0,0 +1,14 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail20658.d(14): Error: field `U.m` cannot modify fields in `@safe` code that overlap fields with other storage classes
+---
+*/
+
+union U
+{
+ int m;
+ immutable int i;
+}
+U u;
+enum e = () @safe { u.m = 13; };