https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68164

--- Comment #3 from Casey Carter <Casey at Carter dot net> ---
Apologies for the vagueness of my response; I actually needed your quote from
[class.cdtor]/3 to complete it:

"To ... access the value of ... a direct non-static member of an object obj,
the construction of obj shall have started and its destruction shall not have
completed, otherwise ... accessing the member value ... results in undefined
behavior."

The access to bp[i].data in the for loop inside the catch clause is the access
to which I was referring. This access clearly happens outside the lifetime of
any of the B objects. The destruction of bp[i] has completed for i in [0, 2) -
so these accesses are UB per [class.cdtor]/3 - and the lifetime of bp[i] for i
in [2, N) has not yet begun - these accesses are UB per [basic.life]/5.2.

Reply via email to