Is this a new bug ?

Steven Schveighoffer schveiguy at gmail.com
Sat Sep 24 12:02:54 UTC 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 local

static 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



More information about the Digitalmars-d-learn mailing list