Just checked the C++ spec, and it sees that a conformant
compiler need only give the correct result for offset of
for POD types despite the fact that only a few features,
virtual base classes in particular, cause problems for
g++ was kind enough to not be pedantic about
it and just make it work for all the normal cases.
SunCC seems to have decided to take advantage
of the spec (and developers) and just throw an
error even if it could deliver the offset at compile time.
This could be worked around via some C++/template
hijinks which would encoded the offset via a template
parameter class with a single functions, yada yada,
thus moving the constant into a function call which
presumably the optimizer would inline and which
would result in the same code.
I suppose it is too much to hope that the C++ committee
will pull their head out and realize that if folks really
wanted to use a high level language they would be using
scala or F# or something and that they should leave the
low level functionality in C++ alone