__gshared static

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 24 11:52:53 PDT 2015


On 4/24/15 2:47 PM, bearophile wrote:
> Steven Schveighoffer:
>
>> These are the same, __gshared overrides static.
>
> Isn't forbidding "__gshared static" a good idea then, to avoid user
> confusion?

Surely, prohibiting non-functioning attributes is good when it's obvious 
that they do nothing.

BUT... there is an issue:

static: __gshared int x;

Should this be an error? I believe inside the compiler, the reason 
unused attributes are ignored are because this is handled the same way, 
and making it error would make all of them error. But that's kind of a 
guess.

-Steve



More information about the Digitalmars-d-learn mailing list