This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


1242. Initializing variant class members

Section: 11.9.3  [class.base.init]     Status: C++11     Submitter: Ryou Ezoe     Date: 2011-02-08

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

The current wording of 11.9.3 [class.base.init] paragraph 5 says,

A ctor-initializer may initialize the member of an anonymous union that is a member of the constructor's class.

The wording “the member” is strange; furthermore, this should be restricted to non-static data members. That could be accomplished by using the existing term “variant members,” which is defined in 11.5 [class.union] paragraph 8 to be “the non-static data members of all anonymous unions that are members of” the class (which by definition must be non-static data members, since a storage class specifier is not allowed on an anonymous union in class scope).