http://d.puremagic.com/issues/show_bug.cgi?id=4419


Trass3r <mrmoc...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #2 from Trass3r <mrmoc...@gmx.de> 2011-02-23 06:13:36 PST ---
Ok, part of the magic happens in StorageClassDeclaration::semantic() in
attrib.c (which btw duplicates setScope!):

StorageClass scstc = sc->stc;

/* These sets of storage classes are mutually exclusive,
 * so choose the innermost or most recent one.
 */
if (stc & (STCauto | STCscope | STCstatic | STCextern | STCmanifest))
    scstc &= ~(STCauto | STCscope | STCstatic | STCextern | STCmanifest);
if (stc & (STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared))
    scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest |
STCgshared);
...
scstc |= stc;

In b's case sc->stc is 0, thus nothing gets truncated and scstc = stc, which is
ok cause stc correctly was set to STCstatic | STCgshared before.

In a's case however sc->stc == STCgshared, so it gets cut out by the second if
statement. Then scstc is set to stc which is equal to STCstatic.


So there are in fact 4 issues here:
1) Why is static and __gshared mutually exclusive, doesn't __gshared imply
static?
2) Why isn't shared handled in that list?
3) Why the difference regarding to the scopes? According to my debug view they
are perfectly identical except for the storage class.
4) Why the difference in stc?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to