Does it mean that I can safely attempt to use this with non standard-layout classes?
If the implementation permits it. Being conditionally supported means this must be documented.
How is "conditionally-supported" different from implementation defined?
To quote the standard on this:
[defns.cond.supp] conditionally-supported - "program construct that an implementation is not required to support"
[defns.impl.defined] implementation-defined behavior - "behavior, for a well-formed program construct and correct data, that depends on the implementation and that each implementation documents"
The key difference is what choice the implementation has. Do it exactly as the standard says, or not at all. Vs. doing it in one of several ways without an option to refuse.
Is a compiler not supporting offsetof
for a particular type of class required to produce a diagnostic?
If it's a conforming implementation, it will issue a diagnostic ([intro.compliance]/2.2 courtesy of @T.C.):
"If a program contains a violation of any diagnosable rule or an occurrence of a construct described in this document as “conditionally-supported” when the implementation does not support that construct, a conforming implementation shall issue at least one diagnostic message."
offsetof
is in the process of being revised for C++20, getting rid of the "conditionally-supported" part, adding the notion of stable-layout classes, and/or extending the current definition of standard-layout. I don't remember the specifics though, and can't remember where I read that :/ – Bertha