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


1357. brace-or-equal-initializers for function and typedef members

Section: 11.4  [class.mem]     Status: CD3     Submitter: Richard Smith     Date: 2011-08-16

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

The grammar allows a brace-or-equal-initializer for any class member with a member-declarator, including typedef members and member function declarations, and there is no semantic restriction forbidding those forms, either.

Proposed resolution (August, 2011):

In 11.4 [class.mem], delete paragraph 4 and change paragraph 5 as follows:

A member can be initialized using a constructor; see 11.4.5 [class.ctor]. [Note: See 11.4.4 [special] for a description of constructors and other special member functions. —end note]

A member can be initialized using a brace-or-equal-initializer shall appear only in the declaration of a data member. (For static data members, see 11.4.9.3 [class.static.data]; for non-static data members, see 11.9.3 [class.base.init]).