From: Stefan S. <se...@sy...> - 2005-10-21 02:37:38
|
Gilles J. Seguin wrote: >>3- is >> const static size_t __align = ( >> __alignof__(_Tp) >= sizeof(_Block_record) >> ? __alignof__(_Tp) >> : sizeof(_Block_record) >> ); > > > we accept static const > static > const > but not const static Right, that's another point. occ expects declarations to start with an optional storage-class-specifier, followed by a type-id and a declarator-list, while the actual C++ grammar lets declarations start with a decl-specifier-seq, followed by a declarator-list. Thus, 'static' may appear (much to my own surprize when I looked that up in the spec not long ago !) in the middle of the decl-specifier-seq, as does 'typedef' and 'mutable'. Fixing this in the occ parser is almost impossible, and it would impact the parse tree structure. (meaning all the walkers need to be updated !) Luckily, not many will write code like int typedef Int; void static foo(); but once you get such code from a std library you are in trouble. Regards, Stefan |