So the destructor is implicitly invoked when the block exits.
I do not see what you see. Optimizers are known to shuffle pieces of
code around.
People *observed* the destructors to be invoked at the end and
*bigger* block
because optimizer moved it and supposedly because standard does not
disabllow it
such optimizations *especially* for no-side-effects destructor.
I do not mind optimizer shuffling around the no-side-effect
destructors
(provided that behaviour is preserved).
For side-effects destructor, Michael showed that standard disallows
moving the destructor invocation to *earlier* point.
To me, that looks like permission for the optimizer to
move destructor invocation to the later point, for side-effects dtors,
and
(2) to move the no-side-effects dtors invocation forward or backward
(conditioned that it preserves results and behaviour, of course).
I *do not* see where standard disallows the optimizer to move
the side-effect destructor to later point. Where do you see this ?
And given that people observed that optimizer moved destructor
invocation
to the end of *bigger* block, my question still remains, is this
standard conformant, and does it make the diffence whether dtor has
side effects or not wrt standard conformance ?
declaration. [...]
with side effects).