Ordering of Storage Attributes

There is no prescribed ordering of the various keywords and constructions that have anything to do with storage. The closest to a standard order, of sorts, is given by the compiler’s own practice when listing them

Note that the compiler’s lists for these purposes need not show all an object’s storage attributes, just a selection. The order however is always the same.

Storage Modifiers

First are the keywords that the compiler treats formally as storage modifiers, plus virtual:

Note that what is shown may have been specified differently: inline may have originated as __inline, __sealed as __declspec (sealed), and __gc as __declspec (managed) or __declspec (__managed).

Storage Class

Next come the keywords that the compiler treats as storage classes. They are mutually exclusive.

Extended Attributes

The list ends with extended attributes as arguments in one __declspec: