www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23313] New: Accessing TLS is apparently fine from shared

https://issues.dlang.org/show_bug.cgi?id=23313

          Issue ID: 23313
           Summary: Accessing TLS is apparently fine from shared context
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mail skoppe.eu

dg1 fails because `i` is not shared.

You would expect dg2 to fail as well. Somehow because `j` is an TLS variable
however, it is suddenly fine.

```
void main()  safe {
    int i = 1;
    static int j = 2;
    auto dg1 = () shared  safe => i; // error
    auto dg2 = () shared  safe => j; // no error??
}
```

--
Aug 29 2022