dmd/compiler/test/fail_compilation/fail4923.d
Dennis c3d0b1ff88
Fix 24056 - const uninitialized data at module scope is not in TLS (#15458)
* Fix 24056 - const uninitialized data at module scope is not in TLS

* Update tests

* Add changelog entry
2023-07-28 17:04:00 +02:00

17 lines
535 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail4923.d(5): Error: immutable variable `bar` initialization is not allowed in `static this`
fail_compilation/fail4923.d(5): Use `shared static this` instead.
fail_compilation/fail4923.d(6): Deprecation: const variable `baz` initialization is not allowed in `static this`
fail_compilation/fail4923.d(6): Use `shared static this` instead.
---
*/
#line 1
immutable int bar;
const int baz; // https://issues.dlang.org/show_bug.cgi?id=24056
static this()
{
bar = 42;
baz = 43;
}