-
-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 24056 - const uninitialized data at module scope is not in TLS
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail4923.d(4): Error: immutable variable `bar` initialization is not allowed in `static this` | ||
fail_compilation/fail4923.d(4): Use `shared static this` instead. | ||
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; | ||
} |