Title
Destruction of union members with member initializers
Status
nad
Section
14.3 [except.ctor]
Submitter
Vinny Romano

Created on 2013-02-15.00:00:00 last changed 140 months ago

Messages

Date: 2013-04-15.00:00:00

Rationale (April, 2013):

Although the active member in a member union is determined by an initializer, it could change during the execution of the constructor's compound=statement.

Date: 2022-11-20.07:54:16

According to 14.3 [except.ctor] paragraph 2,

An object of any storage duration whose initialization or destruction is terminated by an exception will have destructors executed for all of its fully constructed subobjects (excluding the variant members of a union-like class)...

The restriction for variant members does not appear to be necessary when there is a mem-initializer or non-static data member initializer for a union member, as that determines which union member is active during the execution of the constructor.

History
Date User Action Args
2013-05-03 00:00:00adminsetmessages: + msg4444
2013-05-03 00:00:00adminsetstatus: open -> nad
2013-02-15 00:00:00admincreate