[Issue 5110] Excess attribute propagation of structs and classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 24 02:06:51 PDT 2010


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



--- Comment #1 from Shin Fujishiro <rsinfu at gmail.com> 2010-10-24 02:05:22 PDT ---
The current ClassDeclaration uses the following black list for masking
attributes to propagate over its members:
--------------------
sc->stc &= ~(STCfinal | STCauto | STCscope | STCstatic |
             STCabstract | STCdeprecated | STC_TYPECTOR | STCtls | STCgshared);
sc->stc |= storage_class & STC_TYPECTOR;
--------------------

The following STCs pass the black list:

  STCextern, STCparameter, STCfield, STCoverride, STCsynchronized,
  STCin, STCout, STClazy, STCforeach, STCcomdat, STCvariadic,
  STCctorinit, STCtemplateparameter, STCref, STCinit, STCmanifest,
  STCnodtor, STCnothrow, STCpure, STCalias, STCproperty, STCsafe,
  STCtrusted, STCsystem, STCctfe, STCdisable, STCresult.

Currently, the STCs above are propagated inside a class.  Some STCs such as
STCparameter and STCout cannot be applied to class declarations; removing such
insignificant STCs, I got the following list:

  STCextern, STCoverride, STCsynchronized, STCref, STCnothrow,
  STCpure, STCproperty, STCsafe, STCtrusted, STCsystem, STCdisable.

Among them, the only STCs with which propagation makes sense are:

  STCsynchronized, STCnothrow, STCpure, STCsafe, STCtrusted,
  STCsystem, STCdisable.

Other STCs such as STCoverride should not be propagated (the reported problem).

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


More information about the Digitalmars-d-bugs mailing list