That's one way to look at it. I prefer to think of it as that the
local i in B and B::i in C are the same variable, so they should
behave the same, and i in B accesses the storage in A both for reading
and writing.

Anyway, I agree that reading zero from B::i is wrong.

Another odd thing is that it's no problem to instantiate a B by itself
(and it does in fact not have any storage for the variable). Then the
local i in B will behave like B::i in my example, i.e. produce 0 when
read and a runtime error when written.

Spontaneously I expected a runtime error already at object
instantiation, but I guess this is consistent with having declared
functions without definitions. Then it follows that both reading and
writing such variables must be runtime errors.

Reply via email to