You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example never actually calls f, so this is not a problem. The purpose of the example is to show the meaning of different syntactic forms for invoking the destructor, as evidenced by the comments, not to present a program without undefined behavior.
It makes multiple
B
's andD
's destructor calls toD_object
directly and indirectly viaB_ptr
, which is illegal according to [class.dtor]/19.It's also illegal according to [basic.life]/9. Because
D
's destructor is non-trivial and a newD
object is not constructed in place.The text was updated successfully, but these errors were encountered: