digitalmars.D.learn - Is this a new bug ?
- test123 (14/14) Sep 23 2022 If so please report it for me to bugs platform. I can not
- rikki cattermole (15/15) Sep 24 2022 ```d
- test123 (3/18) Sep 24 2022 I think it should not be thread local.
- Adam D Ruppe (7/8) Sep 24 2022 This isn't a bug, the effect of keyword: things stop at the
- Steven Schveighoffer (6/20) Sep 24 2022 static does nothing to module level variables.
If so please report it for me to bugs platform. I can not register one. ```d package { version(TEST) { static: } else { __gshared: } uint test = 0; } ``` ldmd2 -betterC -vtls -c ./test.d ./test.d(7): `test` is thread local
Sep 23 2022
```d version(all) { __gshared: uint test2; } uint test; ``` Output with -vtls: ``` Up to 2.079.1: Success with output: onlineapp.d(9): test is thread local Since 2.080.1: Success with output: onlineapp.d(9): `test` is thread local ``` Looks fine to me.
Sep 24 2022
On Saturday, 24 September 2022 at 07:11:12 UTC, rikki cattermole wrote:```d version(all) { __gshared: uint test2; } uint test; ``` Output with -vtls: ``` Up to 2.079.1: Success with output: onlineapp.d(9): test is thread local Since 2.080.1: Success with output: onlineapp.d(9): `test` is thread local ``` Looks fine to me.I think it should not be thread local.
Sep 24 2022
On Saturday, 24 September 2022 at 06:13:55 UTC, test123 wrote:If so please report it for me to bugs platform.This isn't a bug, the effect of keyword: things stop at the matching }. (static if and version don't introduce a namespace scope, but they still follow this rule for the { colon: ... } blocks) You need to duplicate your uint test2 variable inside those branches.
Sep 24 2022
On Saturday, 24 September 2022 at 06:13:55 UTC, test123 wrote:If so please report it for me to bugs platform. I can not register one. ```d package { version(TEST) { static: } else { __gshared: } uint test = 0; } ``` ldmd2 -betterC -vtls -c ./test.d ./test.d(7): `test` is thread localstatic does nothing to module level variables. Without attributes, test will be thread local. Your attributes are having no effect on the variable because they don’t apply outside the braces. -Steve
Sep 24 2022