If this is not possible to have TLS static variables in a c++ class then this should be rejected by a standard frontend error. For now it's a (sort of) ICE.
test case:
---
extern(C++) class C{ static C[] cs; }
---
output
> /tmp/temp_7FB810174D70.d:1:32: Error: variable `temp_7FB810174D70.C.cs` Internal Compiler Error: C++ static non-`__gshared` non-`extern` variables not supported
that should be an error issued during semantic, not as it is now
Comment #1 by b2.temp — 2020-10-15T13:42:09Z
lower to normal issue as, as someone pointed me, it's possible to write
---
extern(C++) class C{extern(D) static C[] cs; }
---
which could be be suggested in the diagnostic maybe.
But at least the problem is not a blocker, it's just about an unaesthetic message.
Comment #2 by ibuclaw — 2022-05-13T15:43:35Z
*** This issue has been marked as a duplicate of issue 16575 ***
Comment #3 by ibuclaw — 2022-05-13T18:13:50Z
Oops, this refers to static variable types, not functions.
Comment #4 by dlang-bot — 2022-05-15T17:20:02Z
@ibuclaw updated dlang/dmd pull request #14125 "fix Issue 16575 - [ICE] extern(C++) function with D specific types" fixing this issue:
- fix Issue 21314 - ICE on extern(c++) static class variables
https://github.com/dlang/dmd/pull/14125
Comment #5 by dlang-bot — 2022-05-16T10:53:41Z
dlang/dmd pull request #14125 "fix Issue 16575 - [ICE] extern(C++) function with D specific types" was merged into master:
- 4ad6300a55b6116705cb008415ec825ead66446a by Iain Buclaw:
fix Issue 21314 - ICE on extern(C++) static class variables
https://github.com/dlang/dmd/pull/14125