Title
Assignment in member initializer
Status
nad
Section
11.9.3 [class.base.init]
Submitter
John Spicer

Created on 2013-03-15.00:00:00 last changed 141 months ago

Messages

Date: 2013-04-15.00:00:00

Rationale (April, 2013):

CWG saw no problems with the example. It did note, however, that the assignment to x is not an initialization, so x would not be considered to have been initialized by this example.

Date: 2022-11-20.07:54:16

There appears to be no prohibition of assignments in member initializer expressions (neither mem-initializers nor brace-or-equal-initializers):

  struct A {
    int x;
    int y = x = 37;
  };

This seems surprising. Should it be allowed?

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