aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/shared.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/shared.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/shared.d19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/shared.d b/gcc/testsuite/gdc.test/fail_compilation/shared.d
index afdea64..8b94a79 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/shared.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/shared.d
@@ -259,3 +259,22 @@ void test_casting_safe() @safe
auto x1 = cast(int*)s;
auto x2 = cast(const(shared(int*)))s;
}
+
+#line 3100
+
+// https://issues.dlang.org/show_bug.cgi?id=23783
+
+/*
+TEST_OUTPUT:
+---
+fail_compilation/shared.d(3114): Error: direct access to shared `x` is not allowed, see `core.atomic`
+fail_compilation/shared.d(3115): Error: direct access to shared `x` is not allowed, see `core.atomic`
+---
+*/
+
+void test23783()
+{
+ shared int x = 3;
+ assert(x == 3);
+ bool b = x == 3;
+}